/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = '';
  
  checkConfig(config);
  @endpoint = getEndpoint('quanmiaolightapp', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model CancelAsyncTaskRequest {
  taskId?: string(name='taskId', example='a3d1c2ac-f086-4a21-9069-f5631542f5a2'),
}

model CancelAsyncTaskResponseBody = {
  code?: string(name='code', example='NoPermission'),
  data?: boolean(name='data', example='true'),
  httpStatusCode?: int32(name='httpStatusCode', example='403'),
  message?: string(name='message'),
  requestId?: string(name='requestId', description='Id of the request', example='117F5ABE-CF02-5502-9A3F-E56BC9081A64'),
  success?: boolean(name='success', example='false'),
}

model CancelAsyncTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CancelAsyncTaskResponseBody(name='body'),
}

/**
 * @summary 取消异步任务
 *
 * @param request CancelAsyncTaskRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CancelAsyncTaskResponse
 */
async function cancelAsyncTaskWithOptions(workspaceId: string, request: CancelAsyncTaskRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CancelAsyncTaskResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.taskId)) {
    body['taskId'] = request.taskId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CancelAsyncTask',
    version = '2024-08-01',
    protocol = 'HTTPS',
    pathname = `/${OpenApiUtil.getEncodeParam(workspaceId)}/quanmiao/lightapp/cancelAsyncTask`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 取消异步任务
 *
 * @param request CancelAsyncTaskRequest
 * @return CancelAsyncTaskResponse
 */
async function cancelAsyncTask(workspaceId: string, request: CancelAsyncTaskRequest): CancelAsyncTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return cancelAsyncTaskWithOptions(workspaceId, request, headers, runtime);
}

model ExportAnalysisTagDetailByTaskIdRequest {
  categories?: [ string ](name='categories'),
  category?: string(name='category'),
  taskId?: string(name='taskId', description='This parameter is required.', example='a3d1c2ac-f086-4a21-9069-f5631542f5a2'),
}

model ExportAnalysisTagDetailByTaskIdShrinkRequest {
  categoriesShrink?: string(name='categories'),
  category?: string(name='category'),
  taskId?: string(name='taskId', description='This parameter is required.', example='a3d1c2ac-f086-4a21-9069-f5631542f5a2'),
}

model ExportAnalysisTagDetailByTaskIdResponseBody = {
  code?: string(name='code', example='xx'),
  data?: string(name='data', example='http://www.example.com/xxxx.xlsx'),
  httpStatusCode?: int32(name='httpStatusCode', example='200'),
  message?: string(name='message', example='ok'),
  requestId?: string(name='requestId', description='Id of the request', example='085BE2D2-BB7E-59A6-B688-F2CB32124E7F'),
}

model ExportAnalysisTagDetailByTaskIdResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ExportAnalysisTagDetailByTaskIdResponseBody(name='body'),
}

/**
 * @summary 导出挖掘任务明细
 *
 * @param tmpReq ExportAnalysisTagDetailByTaskIdRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ExportAnalysisTagDetailByTaskIdResponse
 */
async function exportAnalysisTagDetailByTaskIdWithOptions(workspaceId: string, tmpReq: ExportAnalysisTagDetailByTaskIdRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ExportAnalysisTagDetailByTaskIdResponse {
  Util.validateModel(tmpReq);
  var request = new ExportAnalysisTagDetailByTaskIdShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.categories)) {
    request.categoriesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.categories, 'categories', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.categoriesShrink)) {
    body['categories'] = request.categoriesShrink;
  }
  if (!Util.isUnset(request.category)) {
    body['category'] = request.category;
  }
  if (!Util.isUnset(request.taskId)) {
    body['taskId'] = request.taskId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ExportAnalysisTagDetailByTaskId',
    version = '2024-08-01',
    protocol = 'HTTPS',
    pathname = `/${OpenApiUtil.getEncodeParam(workspaceId)}/quanmiao/lightapp/exportAnalysisTagDetailByTaskId`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 导出挖掘任务明细
 *
 * @param request ExportAnalysisTagDetailByTaskIdRequest
 * @return ExportAnalysisTagDetailByTaskIdResponse
 */
async function exportAnalysisTagDetailByTaskId(workspaceId: string, request: ExportAnalysisTagDetailByTaskIdRequest): ExportAnalysisTagDetailByTaskIdResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return exportAnalysisTagDetailByTaskIdWithOptions(workspaceId, request, headers, runtime);
}

model GenerateBroadcastNewsRequest {
  prompt?: string(name='prompt', description='This parameter is required.'),
}

model GenerateBroadcastNewsResponseBody = {
  code?: string(name='code', example='xx'),
  data?: {
    hotTopicSummaries?: [ 
      {
        category?: string(name='category'),
        hotTopic?: string(name='hotTopic'),
        hotTopicVersion?: string(name='hotTopicVersion', example='2024-09-13_08'),
        hotValue?: double(name='hotValue', example='1000000'),
        id?: string(name='id', example='1458tb3bjo7531kap42a'),
        images?: [ 
          {
            url?: string(name='url', example='http://xxx.com/xxx.jpeg'),
          }
        ](name='images'),
        textSummary?: string(name='textSummary', example='xxx'),
      }
    ](name='hotTopicSummaries'),
    sessionId?: string(name='sessionId', example='2bb0ea82dafd48a8817fadc4c90e2b52'),
    taskId?: string(name='taskId', example='3feb69ed02d9b1a17d0f1a942675d300'),
    text?: string(name='text'),
    usage?: {
      inputTokens?: long(name='inputTokens', example='1'),
      outputTokens?: long(name='outputTokens', example='2'),
      totalTokens?: long(name='totalTokens', example='3'),
    }(name='usage'),
  }(name='data'),
  httpStatusCode?: int32(name='httpStatusCode', example='200'),
  message?: string(name='message', example='success'),
  requestId?: string(name='requestId', example='117F5ABE-CF02-5502-9A3F-E56BC9081A64'),
  success?: boolean(name='success', example='True'),
}

model GenerateBroadcastNewsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GenerateBroadcastNewsResponseBody(name='body'),
}

/**
 * @summary 新闻播报-抽取分类获取播报热点
 *
 * @param request GenerateBroadcastNewsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GenerateBroadcastNewsResponse
 */
async function generateBroadcastNewsWithOptions(workspaceId: string, request: GenerateBroadcastNewsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GenerateBroadcastNewsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.prompt)) {
    body['prompt'] = request.prompt;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GenerateBroadcastNews',
    version = '2024-08-01',
    protocol = 'HTTPS',
    pathname = `/${OpenApiUtil.getEncodeParam(workspaceId)}/quanmiao/lightapp/GenerateBroadcastNews`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 新闻播报-抽取分类获取播报热点
 *
 * @param request GenerateBroadcastNewsRequest
 * @return GenerateBroadcastNewsResponse
 */
async function generateBroadcastNews(workspaceId: string, request: GenerateBroadcastNewsRequest): GenerateBroadcastNewsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return generateBroadcastNewsWithOptions(workspaceId, request, headers, runtime);
}

model GenerateOutputFormatRequest {
  businessType?: string(name='businessType', example='clueMining'),
  content?: string(name='content', example='待分析文本'),
  extraInfo?: string(name='extraInfo', example='额外信息'),
  tags?: [ 
    {
      tagDefinePrompt?: string(name='tagDefinePrompt', example='xxxx'),
      tagName?: string(name='tagName', example='xxxx'),
    }
  ](name='tags', description='This parameter is required.'),
  taskDescription?: string(name='taskDescription', example='给你一条待分析文本数据，请你按照标签体系来对数据进行打标。'),
}

model GenerateOutputFormatShrinkRequest {
  businessType?: string(name='businessType', example='clueMining'),
  content?: string(name='content', example='待分析文本'),
  extraInfo?: string(name='extraInfo', example='额外信息'),
  tagsShrink?: string(name='tags', description='This parameter is required.'),
  taskDescription?: string(name='taskDescription', example='给你一条待分析文本数据，请你按照标签体系来对数据进行打标。'),
}

model GenerateOutputFormatResponseBody = {
  code?: string(name='code', example='successful'),
  data?: {
    outputFormat?: string(name='outputFormat'),
  }(name='data'),
  httpStatusCode?: int32(name='httpStatusCode', example='200'),
  message?: string(name='message', example='ok'),
  requestId?: string(name='requestId', description='Id of the request', example='117F5ABE-CF02-5502-9A3F-E56BC9081A64'),
  success?: boolean(name='success', example='True'),
}

model GenerateOutputFormatResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GenerateOutputFormatResponseBody(name='body'),
}

/**
 * @summary 轻应用-标签挖掘-获取示例输出格式
 *
 * @param tmpReq GenerateOutputFormatRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GenerateOutputFormatResponse
 */
async function generateOutputFormatWithOptions(workspaceId: string, tmpReq: GenerateOutputFormatRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GenerateOutputFormatResponse {
  Util.validateModel(tmpReq);
  var request = new GenerateOutputFormatShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.tags)) {
    request.tagsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tags, 'tags', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.businessType)) {
    body['businessType'] = request.businessType;
  }
  if (!Util.isUnset(request.content)) {
    body['content'] = request.content;
  }
  if (!Util.isUnset(request.extraInfo)) {
    body['extraInfo'] = request.extraInfo;
  }
  if (!Util.isUnset(request.tagsShrink)) {
    body['tags'] = request.tagsShrink;
  }
  if (!Util.isUnset(request.taskDescription)) {
    body['taskDescription'] = request.taskDescription;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GenerateOutputFormat',
    version = '2024-08-01',
    protocol = 'HTTPS',
    pathname = `/${OpenApiUtil.getEncodeParam(workspaceId)}/quanmiao/lightapp/generateOutputFormat`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 轻应用-标签挖掘-获取示例输出格式
 *
 * @param request GenerateOutputFormatRequest
 * @return GenerateOutputFormatResponse
 */
async function generateOutputFormat(workspaceId: string, request: GenerateOutputFormatRequest): GenerateOutputFormatResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return generateOutputFormatWithOptions(workspaceId, request, headers, runtime);
}

model GetEnterpriseVocAnalysisTaskRequest {
  taskId?: string(name='taskId', example='a3d1c2ac-f086-4a21-9069-f5631542f5a2'),
}

model GetEnterpriseVocAnalysisTaskResponseBody = {
  code?: string(name='code', example='NoPermission'),
  data?: {
    errorMessage?: string(name='errorMessage'),
    modelId?: string(name='modelId', example='qwen-max'),
    modelName?: string(name='modelName'),
    statisticsOverview?: {
      count?: int32(name='count', example='17'),
      filterDimensionStatistics?: {
        tagValueCountStatistic?: [ 
          {
            tagName?: string(name='tagName'),
            valueCount?: int32(name='valueCount', example='10'),
          }
        ](name='tagValueCountStatistic'),
      }(name='filterDimensionStatistics'),
      tagDimensionStatistics?: {
        tagValueCountStatistic?: [ 
          {
            tagName?: string(name='tagName'),
            valueCount?: int32(name='valueCount', example='10'),
          }
        ](name='tagValueCountStatistic'),
      }(name='tagDimensionStatistics'),
    }(name='statisticsOverview'),
    status?: string(name='status', example='PENDING'),
    usage?: {
      inputTokens?: int32(name='inputTokens', example='1'),
      outputTokens?: int32(name='outputTokens', example='2'),
    }(name='usage'),
  }(name='data'),
  httpStatusCode?: int32(name='httpStatusCode', example='403'),
  message?: string(name='message'),
  requestId?: string(name='requestId', description='Id of the request', example='117F5ABE-CF02-5502-9A3F-E56BC9081A64'),
  success?: boolean(name='success', example='false'),
}

model GetEnterpriseVocAnalysisTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetEnterpriseVocAnalysisTaskResponseBody(name='body'),
}

/**
 * @summary 获取企业VOC分析任务结果
 *
 * @param request GetEnterpriseVocAnalysisTaskRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetEnterpriseVocAnalysisTaskResponse
 */
async function getEnterpriseVocAnalysisTaskWithOptions(workspaceId: string, request: GetEnterpriseVocAnalysisTaskRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetEnterpriseVocAnalysisTaskResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.taskId)) {
    query['taskId'] = request.taskId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetEnterpriseVocAnalysisTask',
    version = '2024-08-01',
    protocol = 'HTTPS',
    pathname = `/${OpenApiUtil.getEncodeParam(workspaceId)}/quanmiao/lightapp/getEnterpriseVocAnalysisTask`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取企业VOC分析任务结果
 *
 * @param request GetEnterpriseVocAnalysisTaskRequest
 * @return GetEnterpriseVocAnalysisTaskResponse
 */
async function getEnterpriseVocAnalysisTask(workspaceId: string, request: GetEnterpriseVocAnalysisTaskRequest): GetEnterpriseVocAnalysisTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getEnterpriseVocAnalysisTaskWithOptions(workspaceId, request, headers, runtime);
}

model GetTagMiningAnalysisTaskRequest {
  taskId?: string(name='taskId', example='a3d1c2ac-f086-4a21-9069-f5631542f5a2'),
}

model GetTagMiningAnalysisTaskResponseBody = {
  code?: string(name='code', example='successful'),
  data?: {
    errorCode?: string(name='errorCode'),
    errorMessage?: string(name='errorMessage'),
    results?: [ 
      {
        customId?: string(name='customId', example='1'),
        header?: {
          errorCode?: string(name='errorCode', example='DataNotExists'),
          errorMessage?: string(name='errorMessage'),
          event?: string(name='event', example='task-finished'),
          requestId?: string(name='requestId', example='085BE2D2-BB7E-59A6-B688-F2CB32124E7F'),
        }(name='header'),
        payload?: {
          output?: {
            text?: string(name='text', example='xxxx'),
          }(name='output'),
          usage?: {
            inputToken?: long(name='inputToken', example='100'),
            outputToken?: long(name='outputToken', example='200'),
            totalToken?: long(name='totalToken', example='300'),
          }(name='usage'),
        }(name='payload'),
      }
    ](name='results'),
    status?: string(name='status', example='RUNNIN'),
  }(name='data'),
  httpStatusCode?: string(name='httpStatusCode', example='200'),
  message?: string(name='message', example='DataNotExists'),
  requestId?: string(name='requestId', description='requestId', example='085BE2D2-BB7E-59A6-B688-F2CB32124E7F'),
  success?: boolean(name='success', example='true'),
}

model GetTagMiningAnalysisTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetTagMiningAnalysisTaskResponseBody(name='body'),
}

/**
 * @summary 获取挖掘分析任务结果
 *
 * @param request GetTagMiningAnalysisTaskRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetTagMiningAnalysisTaskResponse
 */
async function getTagMiningAnalysisTaskWithOptions(workspaceId: string, request: GetTagMiningAnalysisTaskRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetTagMiningAnalysisTaskResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.taskId)) {
    query['taskId'] = request.taskId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetTagMiningAnalysisTask',
    version = '2024-08-01',
    protocol = 'HTTPS',
    pathname = `/${OpenApiUtil.getEncodeParam(workspaceId)}/quanmiao/lightapp/getTagMiningAnalysisTask`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取挖掘分析任务结果
 *
 * @param request GetTagMiningAnalysisTaskRequest
 * @return GetTagMiningAnalysisTaskResponse
 */
async function getTagMiningAnalysisTask(workspaceId: string, request: GetTagMiningAnalysisTaskRequest): GetTagMiningAnalysisTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getTagMiningAnalysisTaskWithOptions(workspaceId, request, headers, runtime);
}

model GetVideoAnalysisConfigResponseBody = {
  code?: string(name='code', example='xx'),
  data?: {
    asyncConcurrency?: int32(name='asyncConcurrency', example='2'),
  }(name='data'),
  httpStatusCode?: int32(name='httpStatusCode', example='200'),
  message?: string(name='message', example='ok'),
  requestId?: string(name='requestId', description='Id of the request', example='085BE2D2-BB7E-59A6-B688-F2CB32124E7F'),
  success?: boolean(name='success', example='True'),
}

model GetVideoAnalysisConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetVideoAnalysisConfigResponseBody(name='body'),
}

/**
 * @summary 视频理解-获取配置
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetVideoAnalysisConfigResponse
 */
async function getVideoAnalysisConfigWithOptions(workspaceId: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetVideoAnalysisConfigResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'GetVideoAnalysisConfig',
    version = '2024-08-01',
    protocol = 'HTTPS',
    pathname = `/${OpenApiUtil.getEncodeParam(workspaceId)}/quanmiao/lightapp/videoAnalysis/getVideoAnalysisConfig`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 视频理解-获取配置
 *
 * @return GetVideoAnalysisConfigResponse
 */
async function getVideoAnalysisConfig(workspaceId: string): GetVideoAnalysisConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getVideoAnalysisConfigWithOptions(workspaceId, headers, runtime);
}

model GetVideoAnalysisTaskRequest {
  taskId?: string(name='taskId', description='This parameter is required.', example='a3d1c2ac-f086-4a21-9069-f5631542f5a2'),
}

model GetVideoAnalysisTaskResponseBody = {
  code?: string(name='code', example='successful'),
  data?: {
    errorMessage?: string(name='errorMessage', example='Access was denied, message: No such namespace namespaces/mjp-test-default.'),
    header?: {
      errorCode?: string(name='errorCode', example='success'),
      errorMessage?: string(name='errorMessage', example='Deduct task already success,Please do not resubmit.token \\\\"369e8f2c-d283-424a-96c4-c83efe08c89e\\\\"'),
      event?: string(name='event', example='TIMEOUT_CLOSE_ORDER'),
      eventInfo?: string(name='eventInfo', example='xxx'),
      sessionId?: string(name='sessionId', example='d5c38cf6-a4bf-4a57-a697-9f449926f0c9'),
      taskId?: string(name='taskId', example='6e223291-729b-4e84-9271-c13ada1a776b'),
      traceId?: string(name='traceId', example='215045f817272303448235204efdef'),
    }(name='header'),
    payload?: {
      output?: {
        resultJsonFileUrl?: string(name='resultJsonFileUrl'),
        videoAnalysisResult?: {
          generateFinished?: boolean(name='generateFinished', example='true'),
          text?: string(name='text', example='xxx'),
          usage?: {
            inputTokens?: long(name='inputTokens', example='0'),
            outputTokens?: long(name='outputTokens', example='0'),
            totalTokens?: long(name='totalTokens', example='0'),
          }(name='usage'),
          videoShotAnalysisResults?: [ 
            {
              endTime?: long(name='endTime', example='1710432000000'),
              startTime?: long(name='startTime', example='2024-10-05 06:22:00'),
              text?: string(name='text'),
            }
          ](name='videoShotAnalysisResults'),
        }(name='videoAnalysisResult'),
        videoCaptionResult?: {
          generateFinished?: boolean(name='generateFinished', example='true'),
          videoCaptions?: [ 
            {
              endTime?: long(name='endTime', example='1736129678000'),
              endTimeFormat?: string(name='endTimeFormat', example='00:01'),
              startTime?: long(name='startTime', example='00:01'),
              startTimeFormat?: string(name='startTimeFormat', example='2025-01-07 11:52:06'),
              text?: string(name='text', example='xxxx'),
            }
          ](name='videoCaptions'),
        }(name='videoCaptionResult'),
        videoGenerateResult?: {
          generateFinished?: boolean(name='generateFinished', example='true'),
          index?: int32(name='index'),
          modelId?: string(name='modelId'),
          modelReduce?: boolean(name='modelReduce'),
          reasonText?: string(name='reasonText'),
          text?: string(name='text', example='xxx'),
          usage?: {
            inputTokens?: long(name='inputTokens', example='1'),
            outputTokens?: long(name='outputTokens', example='1'),
            totalTokens?: long(name='totalTokens', example='2'),
          }(name='usage'),
        }(name='videoGenerateResult'),
        videoGenerateResults?: [ 
          {
            generateFinished?: boolean(name='generateFinished'),
            index?: int32(name='index'),
            modelId?: string(name='modelId'),
            reasonText?: string(name='reasonText'),
            text?: string(name='text'),
            usage?: {
              inputTokens?: long(name='inputTokens'),
              outputTokens?: long(name='outputTokens'),
              totalTokens?: long(name='totalTokens'),
            }(name='usage'),
          }
        ](name='videoGenerateResults'),
        videoMindMappingGenerateResult?: {
          generateFinished?: boolean(name='generateFinished', example='true'),
          text?: string(name='text'),
          usage?: {
            inputTokens?: long(name='inputTokens', example='1'),
            outputTokens?: long(name='outputTokens', example='1'),
            totalTokens?: long(name='totalTokens', example='2'),
          }(name='usage'),
          videoMindMappings?: [ 
            {
              childNodes?: [ 
                {
                  childNodes?: [ 
                    {
                      name?: string(name='name'),
                    }
                  ](name='childNodes'),
                  name?: string(name='name'),
                }
              ](name='childNodes'),
              name?: string(name='name'),
            }
          ](name='videoMindMappings'),
        }(name='videoMindMappingGenerateResult'),
        videoTitleGenerateResult?: {
          generateFinished?: boolean(name='generateFinished', example='true'),
          text?: string(name='text', example='xxxx'),
          usage?: {
            inputTokens?: long(name='inputTokens', example='0'),
            outputTokens?: long(name='outputTokens', example='0'),
            totalTokens?: long(name='totalTokens', example='0'),
          }(name='usage'),
        }(name='videoTitleGenerateResult'),
      }(name='output'),
      usage?: {
        inputTokens?: long(name='inputTokens', example='0'),
        outputTokens?: long(name='outputTokens', example='0'),
        totalTokens?: long(name='totalTokens', example='0'),
      }(name='usage'),
    }(name='payload'),
    taskId?: string(name='taskId', example='3feb69ed02d9b1a17d0f1a942675d300'),
    taskRunInfo?: {
      concurrentChargeEnable?: boolean(name='concurrentChargeEnable', example='true'),
      responseTime?: long(name='responseTime', example='1'),
    }(name='taskRunInfo'),
    taskStatus?: string(name='taskStatus', example='SUCCESSED'),
  }(name='data'),
  httpStatusCode?: int32(name='httpStatusCode', example='200'),
  message?: string(name='message', example='success'),
  requestId?: string(name='requestId', description='Id of the request', example='5D0E915E-655D-59A8-894F-93873F73AAE5'),
  success?: boolean(name='success', example='True'),
}

model GetVideoAnalysisTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetVideoAnalysisTaskResponseBody(name='body'),
}

/**
 * @summary 轻应用-获取视频理解异步任务结果
 *
 * @param request GetVideoAnalysisTaskRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetVideoAnalysisTaskResponse
 */
async function getVideoAnalysisTaskWithOptions(workspaceId: string, request: GetVideoAnalysisTaskRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetVideoAnalysisTaskResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.taskId)) {
    query['taskId'] = request.taskId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetVideoAnalysisTask',
    version = '2024-08-01',
    protocol = 'HTTPS',
    pathname = `/${OpenApiUtil.getEncodeParam(workspaceId)}/quanmiao/lightapp/videoAnalysis/getVideoAnalysisTask`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 轻应用-获取视频理解异步任务结果
 *
 * @param request GetVideoAnalysisTaskRequest
 * @return GetVideoAnalysisTaskResponse
 */
async function getVideoAnalysisTask(workspaceId: string, request: GetVideoAnalysisTaskRequest): GetVideoAnalysisTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getVideoAnalysisTaskWithOptions(workspaceId, request, headers, runtime);
}

model ListHotTopicSummariesRequest {
  category?: string(name='category', example='xx'),
  hotTopic?: string(name='hotTopic', example='xx'),
  hotTopicVersion?: string(name='hotTopicVersion', example='2024-09-13_12'),
  maxResults?: int32(name='maxResults', example='20'),
  nextToken?: string(name='nextToken', example='JlroP3CjgQh5PQDlH3ArzADkBTPZgVqo+64jhZRglNq0mEYoV5SlGb/Juvo8CdfYE9rlwEr2pIJQwdaYotak9g=='),
}

model ListHotTopicSummariesResponseBody = {
  code?: string(name='code', example='xx'),
  data?: [ 
    {
      category?: string(name='category'),
      hotTopic?: string(name='hotTopic', example='xx'),
      hotTopicVersion?: string(name='hotTopicVersion', example='2024-09-13_12'),
      hotValue?: double(name='hotValue', example='1000000'),
      id?: string(name='id', example='db5dc5b3d8954a30b65ba700c9dda3bb'),
      news?: [ 
        {
          comments?: [ 
            {
              text?: string(name='text', example='xx'),
            }
          ](name='comments'),
          content?: string(name='content', example='xx'),
          pubTime?: string(name='pubTime', example='2024-09-10 15:32:00'),
          title?: string(name='title', example='xx'),
          url?: string(name='url', description='url', example='http://xxx'),
        }
      ](name='news'),
      summary?: {
        summaries?: [ 
          {
            summary?: string(name='summary', example='xx'),
            title?: string(name='title', example='xx'),
          }
        ](name='summaries'),
      }(name='summary'),
      textSummary?: string(name='textSummary', example='xx'),
    }
  ](name='data'),
  httpStatusCode?: int32(name='httpStatusCode', example='200'),
  maxResults?: int32(name='maxResults', example='20'),
  message?: string(name='message', example='success'),
  nextToken?: string(name='nextToken', example='JlroP3CjgQh5PQDlH3ArzADkBTPZgVqo+64jhZRglNq0mEYoV5SlGb/Juvo8CdfYE9rlwEr2pIJQwdaYotak9g=='),
  requestId?: string(name='requestId', example='117F5ABE-CF02-5502-9A3F-E56BC9081A64'),
  success?: boolean(name='success', example='True'),
  totalCount?: int32(name='totalCount', example='200'),
}

model ListHotTopicSummariesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListHotTopicSummariesResponseBody(name='body'),
}

/**
 * @summary 轻应用-新闻播报-获取热点话题摘要列表
 *
 * @param request ListHotTopicSummariesRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListHotTopicSummariesResponse
 */
async function listHotTopicSummariesWithOptions(workspaceId: string, request: ListHotTopicSummariesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListHotTopicSummariesResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.category)) {
    body['category'] = request.category;
  }
  if (!Util.isUnset(request.hotTopic)) {
    body['hotTopic'] = request.hotTopic;
  }
  if (!Util.isUnset(request.hotTopicVersion)) {
    body['hotTopicVersion'] = request.hotTopicVersion;
  }
  if (!Util.isUnset(request.maxResults)) {
    body['maxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    body['nextToken'] = request.nextToken;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListHotTopicSummaries',
    version = '2024-08-01',
    protocol = 'HTTPS',
    pathname = `/${OpenApiUtil.getEncodeParam(workspaceId)}/quanmiao/lightapp/listHotTopicSummaries`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 轻应用-新闻播报-获取热点话题摘要列表
 *
 * @param request ListHotTopicSummariesRequest
 * @return ListHotTopicSummariesResponse
 */
async function listHotTopicSummaries(workspaceId: string, request: ListHotTopicSummariesRequest): ListHotTopicSummariesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listHotTopicSummariesWithOptions(workspaceId, request, headers, runtime);
}

model RunEnterpriseVocAnalysisRequest {
  akProxy?: string(name='akProxy'),
  apiKey?: string(name='apiKey'),
  content?: string(name='content', description='需要进行VOC分析的文本内容（content、contents、url、fileKey 四选一。优先级从小到大）', example='这是一段需要分析的文本内容'),
  extraInfo?: string(name='extraInfo'),
  filterTags?: [ 
    {
      tagDefinePrompt?: string(name='tagDefinePrompt', description='标签定义提示词', example='标签定义提示词'),
      tagName?: string(name='tagName', description='标签名称', example='标签名称'),
    }
  ](name='filterTags', description='过滤标签，用于筛选符合条件的内容。'),
  modelId?: string(name='modelId', example='qwen-max'),
  outputFormat?: string(name='outputFormat', description='指定返回结果的格式，支持json或text', example='按照如下格式输出：{"text1": "xxxx", "text2": "xxxx"}'),
  tags?: [ 
    {
      tagDefinePrompt?: string(name='tagDefinePrompt', description='标签定义提示词', example='标签定义提示词'),
      tagName?: string(name='tagName', description='标签名称', example='标签名称'),
    }
  ](name='tags', description='业务标签体系，用于对文本内容进行分类和分析。'),
  taskDescription?: string(name='taskDescription', example='你是一名经验丰富的数据分析师，擅长从文本评论中提取结构化信息。你需要从用户评论列表中识别和提取出与以下四个维度相关的关键词和短语：
            
            索引：输入评论JSON数组中的索引（从零开始）表示针对该条索引抽取的维度。
            购买动机：描述用户购买产品的原因、需求或驱动力的关键词或短语。
            未满足需求点：用户在使用产品过程中提到的未满足需求或问题的关键词或短语。
            使用场景：用户提到的具体使用场景、使用方式或环境的关键词或短语。
            正负面观点：明确表示用户对产品或服务的正面或负面看法的关键词或短语。'),
}

model RunEnterpriseVocAnalysisShrinkRequest {
  akProxy?: string(name='akProxy'),
  apiKey?: string(name='apiKey'),
  content?: string(name='content', description='需要进行VOC分析的文本内容（content、contents、url、fileKey 四选一。优先级从小到大）', example='这是一段需要分析的文本内容'),
  extraInfo?: string(name='extraInfo'),
  filterTagsShrink?: string(name='filterTags', description='过滤标签，用于筛选符合条件的内容。'),
  modelId?: string(name='modelId', example='qwen-max'),
  outputFormat?: string(name='outputFormat', description='指定返回结果的格式，支持json或text', example='按照如下格式输出：{"text1": "xxxx", "text2": "xxxx"}'),
  tagsShrink?: string(name='tags', description='业务标签体系，用于对文本内容进行分类和分析。'),
  taskDescription?: string(name='taskDescription', example='你是一名经验丰富的数据分析师，擅长从文本评论中提取结构化信息。你需要从用户评论列表中识别和提取出与以下四个维度相关的关键词和短语：
            
            索引：输入评论JSON数组中的索引（从零开始）表示针对该条索引抽取的维度。
            购买动机：描述用户购买产品的原因、需求或驱动力的关键词或短语。
            未满足需求点：用户在使用产品过程中提到的未满足需求或问题的关键词或短语。
            使用场景：用户提到的具体使用场景、使用方式或环境的关键词或短语。
            正负面观点：明确表示用户对产品或服务的正面或负面看法的关键词或短语。'),
}

model RunEnterpriseVocAnalysisResponseBody = {
  header?: {
    errorCode?: string(name='errorCode', example='AccessForbidden'),
    errorMessage?: string(name='errorMessage', example='错误信息'),
    event?: string(name='event', example='task-finished'),
    sessionId?: string(name='sessionId', example='xxxx'),
    taskId?: string(name='taskId', example='xxxx'),
    traceId?: string(name='traceId', example='xxxxx'),
  }(name='header'),
  payload?: {
    output?: {
      filterResult?: {
        filterResults?: [ 
          {
            hit?: boolean(name='hit', example='true'),
            tagName?: string(name='tagName'),
            tagValue?: string(name='tagValue'),
          }
        ](name='filterResults'),
      }(name='filterResult'),
      text?: string(name='text'),
    }(name='output'),
    usage?: {
      inputTokens?: long(name='inputTokens', example='100'),
      outputTokens?: long(name='outputTokens', example='100'),
      totalTokens?: long(name='totalTokens', example='200'),
    }(name='usage'),
  }(name='payload'),
  requestId?: string(name='requestId', description='Id of the request', example='49483FFC-0CB9-5163-8D3E-234E276E6DA8'),
}

model RunEnterpriseVocAnalysisResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RunEnterpriseVocAnalysisResponseBody(name='body'),
}

/**
 * @summary 企业VOC分析
 *
 * @param tmpReq RunEnterpriseVocAnalysisRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return RunEnterpriseVocAnalysisResponse
 */
async function runEnterpriseVocAnalysisWithOptions(workspaceId: string, tmpReq: RunEnterpriseVocAnalysisRequest, headers: map[string]string, runtime: Util.RuntimeOptions): RunEnterpriseVocAnalysisResponse {
  Util.validateModel(tmpReq);
  var request = new RunEnterpriseVocAnalysisShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.filterTags)) {
    request.filterTagsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.filterTags, 'filterTags', 'json');
  }
  if (!Util.isUnset(tmpReq.tags)) {
    request.tagsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tags, 'tags', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.akProxy)) {
    body['akProxy'] = request.akProxy;
  }
  if (!Util.isUnset(request.apiKey)) {
    body['apiKey'] = request.apiKey;
  }
  if (!Util.isUnset(request.content)) {
    body['content'] = request.content;
  }
  if (!Util.isUnset(request.extraInfo)) {
    body['extraInfo'] = request.extraInfo;
  }
  if (!Util.isUnset(request.filterTagsShrink)) {
    body['filterTags'] = request.filterTagsShrink;
  }
  if (!Util.isUnset(request.modelId)) {
    body['modelId'] = request.modelId;
  }
  if (!Util.isUnset(request.outputFormat)) {
    body['outputFormat'] = request.outputFormat;
  }
  if (!Util.isUnset(request.tagsShrink)) {
    body['tags'] = request.tagsShrink;
  }
  if (!Util.isUnset(request.taskDescription)) {
    body['taskDescription'] = request.taskDescription;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'RunEnterpriseVocAnalysis',
    version = '2024-08-01',
    protocol = 'HTTPS',
    pathname = `/${OpenApiUtil.getEncodeParam(workspaceId)}/quanmiao/lightapp/runEnterpriseVocAnalysis`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 企业VOC分析
 *
 * @param request RunEnterpriseVocAnalysisRequest
 * @return RunEnterpriseVocAnalysisResponse
 */
async function runEnterpriseVocAnalysis(workspaceId: string, request: RunEnterpriseVocAnalysisRequest): RunEnterpriseVocAnalysisResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return runEnterpriseVocAnalysisWithOptions(workspaceId, request, headers, runtime);
}

model RunHotTopicChatRequest {
  category?: string(name='category'),
  generateOptions?: [ string ](name='generateOptions'),
  hotTopicVersion?: string(name='hotTopicVersion', example='2024-09-13_12'),
  hotTopics?: [ string ](name='hotTopics'),
  imageCount?: int32(name='imageCount', example='1'),
  messages?: [ 
    {
      content?: string(name='content', example='xxx'),
      createTime?: string(name='createTime', example='2024-12-10 18:51:29'),
      role?: string(name='role', example='user'),
    }
  ](name='messages'),
  modelCustomPromptTemplate?: string(name='modelCustomPromptTemplate', example='xx'),
  modelId?: string(name='modelId', example='qwen-max'),
  originalSessionId?: string(name='originalSessionId', example='a3d1c2ac-f086-4a21-9069-f5631542f5ax'),
  prompt?: string(name='prompt'),
  stepForBroadcastContentConfig?: {
    categories?: [ string ](name='categories'),
    customHotValueWeights?: [ 
      {
        dimension?: string(name='dimension', example='comments'),
        weight?: int32(name='weight', example='1'),
      }
    ](name='customHotValueWeights'),
    topicCount?: int32(name='topicCount', example='20'),
  }(name='stepForBroadcastContentConfig'),
  taskId?: string(name='taskId', example='a3d1c2ac-f086-4a21-9069-f5631542f5a2'),
}

model RunHotTopicChatShrinkRequest {
  category?: string(name='category'),
  generateOptionsShrink?: string(name='generateOptions'),
  hotTopicVersion?: string(name='hotTopicVersion', example='2024-09-13_12'),
  hotTopicsShrink?: string(name='hotTopics'),
  imageCount?: int32(name='imageCount', example='1'),
  messagesShrink?: string(name='messages'),
  modelCustomPromptTemplate?: string(name='modelCustomPromptTemplate', example='xx'),
  modelId?: string(name='modelId', example='qwen-max'),
  originalSessionId?: string(name='originalSessionId', example='a3d1c2ac-f086-4a21-9069-f5631542f5ax'),
  prompt?: string(name='prompt'),
  stepForBroadcastContentConfigShrink?: string(name='stepForBroadcastContentConfig'),
  taskId?: string(name='taskId', example='a3d1c2ac-f086-4a21-9069-f5631542f5a2'),
}

model RunHotTopicChatResponseBody = {
  header?: {
    errorCode?: string(name='errorCode', example='InvalidParam'),
    errorMessage?: string(name='errorMessage', example='xx'),
    event?: string(name='event', example='task-finished'),
    eventInfo?: string(name='eventInfo', example='xx'),
    sessionId?: string(name='sessionId', example='xxx'),
    taskId?: string(name='taskId', example='d3be9981-ca2d-4e17-bf31-1c0a628e9f99'),
    traceId?: string(name='traceId', example='2150451a17191950923411783e2927'),
  }(name='header'),
  payload?: {
    output?: {
      articles?: [ 
        {
          content?: string(name='content', example='xxx'),
          pubTime?: string(name='pubTime', example='2024-09-22 16:45:06'),
          score?: double(name='score'),
          searchSourceName?: string(name='searchSourceName'),
          select?: boolean(name='select'),
          summary?: string(name='summary', example='xx'),
          title?: string(name='title', example='test'),
          url?: string(name='url', example='http://xxx'),
        }
      ](name='articles'),
      hotTopicSummaries?: [ 
        {
          customHotValue?: double(name='customHotValue', example='100000'),
          customTextSummary?: string(name='customTextSummary', example='xxx'),
          hotTopic?: string(name='hotTopic', example='xx'),
          hotTopicVersion?: string(name='hotTopicVersion', example='2024-09-13_08'),
          hotValue?: double(name='hotValue', example='100000'),
          images?: [ 
            {
              url?: string(name='url', example='http://xxx'),
            }
          ](name='images'),
          news?: [ 
            {
              title?: string(name='title', example='xxx'),
              url?: string(name='url', example='http://xxx'),
            }
          ](name='news'),
          textSummary?: string(name='textSummary', example='xxx'),
        }
      ](name='hotTopicSummaries'),
      multimodalMedias?: [ 
        {
          fileUrl?: string(name='fileUrl', example='http://xxxx'),
          mediaType?: string(name='mediaType', example='image'),
          sortScore?: double(name='sortScore'),
        }
      ](name='multimodalMedias'),
      recommendQueries?: [ string ](name='recommendQueries'),
      searchQuery?: string(name='searchQuery'),
      text?: string(name='text', example='xx'),
    }(name='output'),
    usage?: {
      inputTokens?: long(name='inputTokens', example='100'),
      outputTokens?: long(name='outputTokens', example='100'),
      totalTokens?: long(name='totalTokens', example='200'),
    }(name='usage'),
  }(name='payload'),
  requestId?: string(name='requestId', example='04DA1A52-4E51-56CB-BA64-FDDA0B53BAE8'),
}

model RunHotTopicChatResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RunHotTopicChatResponseBody(name='body'),
}

/**
 * @summary 轻应用-热点播报-问答
 *
 * @param tmpReq RunHotTopicChatRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return RunHotTopicChatResponse
 */
async function runHotTopicChatWithOptions(workspaceId: string, tmpReq: RunHotTopicChatRequest, headers: map[string]string, runtime: Util.RuntimeOptions): RunHotTopicChatResponse {
  Util.validateModel(tmpReq);
  var request = new RunHotTopicChatShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.generateOptions)) {
    request.generateOptionsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.generateOptions, 'generateOptions', 'json');
  }
  if (!Util.isUnset(tmpReq.hotTopics)) {
    request.hotTopicsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.hotTopics, 'hotTopics', 'json');
  }
  if (!Util.isUnset(tmpReq.messages)) {
    request.messagesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.messages, 'messages', 'json');
  }
  if (!Util.isUnset(tmpReq.stepForBroadcastContentConfig)) {
    request.stepForBroadcastContentConfigShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.stepForBroadcastContentConfig, 'stepForBroadcastContentConfig', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.category)) {
    body['category'] = request.category;
  }
  if (!Util.isUnset(request.generateOptionsShrink)) {
    body['generateOptions'] = request.generateOptionsShrink;
  }
  if (!Util.isUnset(request.hotTopicVersion)) {
    body['hotTopicVersion'] = request.hotTopicVersion;
  }
  if (!Util.isUnset(request.hotTopicsShrink)) {
    body['hotTopics'] = request.hotTopicsShrink;
  }
  if (!Util.isUnset(request.imageCount)) {
    body['imageCount'] = request.imageCount;
  }
  if (!Util.isUnset(request.messagesShrink)) {
    body['messages'] = request.messagesShrink;
  }
  if (!Util.isUnset(request.modelCustomPromptTemplate)) {
    body['modelCustomPromptTemplate'] = request.modelCustomPromptTemplate;
  }
  if (!Util.isUnset(request.modelId)) {
    body['modelId'] = request.modelId;
  }
  if (!Util.isUnset(request.originalSessionId)) {
    body['originalSessionId'] = request.originalSessionId;
  }
  if (!Util.isUnset(request.prompt)) {
    body['prompt'] = request.prompt;
  }
  if (!Util.isUnset(request.stepForBroadcastContentConfigShrink)) {
    body['stepForBroadcastContentConfig'] = request.stepForBroadcastContentConfigShrink;
  }
  if (!Util.isUnset(request.taskId)) {
    body['taskId'] = request.taskId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'RunHotTopicChat',
    version = '2024-08-01',
    protocol = 'HTTPS',
    pathname = `/${OpenApiUtil.getEncodeParam(workspaceId)}/quanmiao/lightapp/runHotTopicChat`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 轻应用-热点播报-问答
 *
 * @param request RunHotTopicChatRequest
 * @return RunHotTopicChatResponse
 */
async function runHotTopicChat(workspaceId: string, request: RunHotTopicChatRequest): RunHotTopicChatResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return runHotTopicChatWithOptions(workspaceId, request, headers, runtime);
}

model RunHotTopicSummaryRequest {
  hotTopicVersion?: string(name='hotTopicVersion', description='This parameter is required.', example='2024-10-16_8'),
  stepForCustomSummaryStyleConfig?: {
    summaryImageCount?: int32(name='summaryImageCount', example='2'),
    summaryModel?: string(name='summaryModel', example='qwen-max'),
    summaryPrompt?: string(name='summaryPrompt', example='xxxx'),
  }(name='stepForCustomSummaryStyleConfig', description='This parameter is required.'),
  topicIds?: [ string ](name='topicIds', description='This parameter is required.', example='xxxxx'),
}

model RunHotTopicSummaryShrinkRequest {
  hotTopicVersion?: string(name='hotTopicVersion', description='This parameter is required.', example='2024-10-16_8'),
  stepForCustomSummaryStyleConfigShrink?: string(name='stepForCustomSummaryStyleConfig', description='This parameter is required.'),
  topicIdsShrink?: string(name='topicIds', description='This parameter is required.', example='xxxxx'),
}

model RunHotTopicSummaryResponseBody = {
  header?: {
    errorCode?: string(name='errorCode', example='AccessForbidden'),
    errorMessage?: string(name='errorMessage', example='错误信息'),
    event?: string(name='event', example='task-finished'),
    sessionId?: string(name='sessionId', example='xxxx'),
    taskId?: string(name='taskId', example='xxxx'),
    traceId?: string(name='traceId', example='xxxxx'),
  }(name='header'),
  payload?: {
    output?: {
      text?: string(name='text'),
      topicId?: string(name='topicId'),
    }(name='output'),
    usage?: {
      inputTokens?: long(name='inputTokens', example='100'),
      outputTokens?: long(name='outputTokens', example='100'),
      totalTokens?: long(name='totalTokens', example='200'),
    }(name='usage'),
  }(name='payload'),
  requestId?: string(name='requestId', description='Id of the request', example='5D0E915E-655D-59A8-894F-93873F73AAE5'),
}

model RunHotTopicSummaryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RunHotTopicSummaryResponseBody(name='body'),
}

/**
 * @summary 轻应用-热点播报-热点摘要生成
 *
 * @param tmpReq RunHotTopicSummaryRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return RunHotTopicSummaryResponse
 */
async function runHotTopicSummaryWithOptions(workspaceId: string, tmpReq: RunHotTopicSummaryRequest, headers: map[string]string, runtime: Util.RuntimeOptions): RunHotTopicSummaryResponse {
  Util.validateModel(tmpReq);
  var request = new RunHotTopicSummaryShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.stepForCustomSummaryStyleConfig)) {
    request.stepForCustomSummaryStyleConfigShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.stepForCustomSummaryStyleConfig, 'stepForCustomSummaryStyleConfig', 'json');
  }
  if (!Util.isUnset(tmpReq.topicIds)) {
    request.topicIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.topicIds, 'topicIds', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.hotTopicVersion)) {
    body['hotTopicVersion'] = request.hotTopicVersion;
  }
  if (!Util.isUnset(request.stepForCustomSummaryStyleConfigShrink)) {
    body['stepForCustomSummaryStyleConfig'] = request.stepForCustomSummaryStyleConfigShrink;
  }
  if (!Util.isUnset(request.topicIdsShrink)) {
    body['topicIds'] = request.topicIdsShrink;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'RunHotTopicSummary',
    version = '2024-08-01',
    protocol = 'HTTPS',
    pathname = `/${OpenApiUtil.getEncodeParam(workspaceId)}/quanmiao/lightapp/runHotTopicSummary`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 轻应用-热点播报-热点摘要生成
 *
 * @param request RunHotTopicSummaryRequest
 * @return RunHotTopicSummaryResponse
 */
async function runHotTopicSummary(workspaceId: string, request: RunHotTopicSummaryRequest): RunHotTopicSummaryResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return runHotTopicSummaryWithOptions(workspaceId, request, headers, runtime);
}

model RunMarketingInformationExtractRequest {
  customPrompt?: string(name='customPrompt'),
  extractType?: string(name='extractType'),
  modelId?: string(name='modelId', example='qwen-max
qwen-plus'),
  sourceMaterials?: [ string ](name='sourceMaterials'),
}

model RunMarketingInformationExtractShrinkRequest {
  customPrompt?: string(name='customPrompt'),
  extractType?: string(name='extractType'),
  modelId?: string(name='modelId', example='qwen-max
qwen-plus'),
  sourceMaterialsShrink?: string(name='sourceMaterials'),
}

model RunMarketingInformationExtractResponseBody = {
  end?: boolean(name='end', example='{\\\\"TimeZone\\\\": \\\\"Asia/Shanghai\\\\", \\\\"DateTime\\\\": \\\\"2024-03-07T17:00:09+08:00\\\\"}'),
  header?: {
    event?: string(name='event', example='result-generated'),
    eventInfo?: string(name='eventInfo'),
    requestId?: string(name='requestId', example='F08C71C0-9399-548C-838B-1DA01DE211B0'),
    sessionId?: string(name='sessionId', example='121dlsga4o7golrl1hojazg0u9lvytjc17ebgzzj2u4zukgh122tfg7wj1e6a1vcowy1ewzinauxriai9atcr6r323mm9ddbr0bg5m61ij8hxnf8664tstlfkfol6m8luc4shs3gums7l46uauyy0xndqmhdjtdon6coyhb4x17bo762bg9e3tb2geufg2'),
    taskId?: string(name='taskId', example='12826092918145'),
    traceId?: string(name='traceId', example='2150432017236011824686132ecdbc'),
  }(name='header'),
  payload?: {
    output?: {
      text?: string(name='text'),
    }(name='output'),
    usage?: {
      inputTokens?: long(name='inputTokens', example='100'),
      outputTokens?: long(name='outputTokens', example='100'),
      totalTokens?: long(name='totalTokens', example='200'),
    }(name='usage'),
  }(name='payload'),
}

model RunMarketingInformationExtractResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RunMarketingInformationExtractResponseBody(name='body'),
}

/**
 * @summary 营销信息抽取服务
 *
 * @param tmpReq RunMarketingInformationExtractRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return RunMarketingInformationExtractResponse
 */
async function runMarketingInformationExtractWithOptions(workspaceId: string, tmpReq: RunMarketingInformationExtractRequest, headers: map[string]string, runtime: Util.RuntimeOptions): RunMarketingInformationExtractResponse {
  Util.validateModel(tmpReq);
  var request = new RunMarketingInformationExtractShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.sourceMaterials)) {
    request.sourceMaterialsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.sourceMaterials, 'sourceMaterials', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.customPrompt)) {
    body['customPrompt'] = request.customPrompt;
  }
  if (!Util.isUnset(request.extractType)) {
    body['extractType'] = request.extractType;
  }
  if (!Util.isUnset(request.modelId)) {
    body['modelId'] = request.modelId;
  }
  if (!Util.isUnset(request.sourceMaterialsShrink)) {
    body['sourceMaterials'] = request.sourceMaterialsShrink;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'RunMarketingInformationExtract',
    version = '2024-08-01',
    protocol = 'HTTPS',
    pathname = `/${OpenApiUtil.getEncodeParam(workspaceId)}/quanmiao/lightapp/runMarketingInformationExtract`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 营销信息抽取服务
 *
 * @param request RunMarketingInformationExtractRequest
 * @return RunMarketingInformationExtractResponse
 */
async function runMarketingInformationExtract(workspaceId: string, request: RunMarketingInformationExtractRequest): RunMarketingInformationExtractResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return runMarketingInformationExtractWithOptions(workspaceId, request, headers, runtime);
}

model RunMarketingInformationWritingRequest {
  apiKey?: string(name='apiKey'),
  customLimitation?: string(name='customLimitation'),
  customPrompt?: string(name='customPrompt'),
  inputExample?: string(name='inputExample'),
  modelId?: string(name='modelId', example='qwen-max
qwen-plus'),
  outputExample?: string(name='outputExample'),
  sourceMaterial?: string(name='sourceMaterial'),
  writingType?: string(name='writingType'),
}

model RunMarketingInformationWritingResponseBody = {
  end?: boolean(name='end', example='2024-06-21T10:29:52+08:00'),
  header?: {
    errorMessage?: string(name='errorMessage'),
    event?: string(name='event', example='result-generated'),
    eventInfo?: string(name='eventInfo'),
    requestId?: string(name='requestId', example='436BC5AE-0573-59D8-9803-6B5FDCD3BBA1'),
    sessionId?: string(name='sessionId', example='uqubxgqzlnf4exfektij032lgb3yvix678p232n56387aqxdo4uutdt9wstqzovvz6j3ho7wnbgye785u79yn5q3euqmsvzmqdn3nmfq2826oscjvsi43kof8b8uxufpp1x97jjukk6jd3183hy8ni6hqpskuhuascpd'),
    taskId?: string(name='taskId', example='13312125943232'),
    traceId?: string(name='traceId', example='213e20e517049392478441155e8b2a'),
  }(name='header'),
  payload?: {
    output?: {
      text?: string(name='text'),
    }(name='output'),
    usage?: {
      inputTokens?: long(name='inputTokens', example='100'),
      outputTokens?: long(name='outputTokens', example='100'),
      totalTokens?: long(name='totalTokens', example='200'),
    }(name='usage'),
  }(name='payload'),
}

model RunMarketingInformationWritingResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RunMarketingInformationWritingResponseBody(name='body'),
}

/**
 * @summary 营销文案写作服务
 *
 * @param request RunMarketingInformationWritingRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return RunMarketingInformationWritingResponse
 */
async function runMarketingInformationWritingWithOptions(workspaceId: string, request: RunMarketingInformationWritingRequest, headers: map[string]string, runtime: Util.RuntimeOptions): RunMarketingInformationWritingResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.apiKey)) {
    body['apiKey'] = request.apiKey;
  }
  if (!Util.isUnset(request.customLimitation)) {
    body['customLimitation'] = request.customLimitation;
  }
  if (!Util.isUnset(request.customPrompt)) {
    body['customPrompt'] = request.customPrompt;
  }
  if (!Util.isUnset(request.inputExample)) {
    body['inputExample'] = request.inputExample;
  }
  if (!Util.isUnset(request.modelId)) {
    body['modelId'] = request.modelId;
  }
  if (!Util.isUnset(request.outputExample)) {
    body['outputExample'] = request.outputExample;
  }
  if (!Util.isUnset(request.sourceMaterial)) {
    body['sourceMaterial'] = request.sourceMaterial;
  }
  if (!Util.isUnset(request.writingType)) {
    body['writingType'] = request.writingType;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'RunMarketingInformationWriting',
    version = '2024-08-01',
    protocol = 'HTTPS',
    pathname = `/${OpenApiUtil.getEncodeParam(workspaceId)}/quanmiao/lightapp/runMarketingInformationWriting`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 营销文案写作服务
 *
 * @param request RunMarketingInformationWritingRequest
 * @return RunMarketingInformationWritingResponse
 */
async function runMarketingInformationWriting(workspaceId: string, request: RunMarketingInformationWritingRequest): RunMarketingInformationWritingResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return runMarketingInformationWritingWithOptions(workspaceId, request, headers, runtime);
}

model RunNetworkContentAuditRequest {
  apiKey?: string(name='apiKey'),
  businessType?: string(name='businessType', example='clueMining'),
  content?: string(name='content', description='This parameter is required.', example='待分析文本'),
  extraInfo?: string(name='extraInfo', example='额外信息'),
  modelId?: string(name='modelId', example='qwen-max'),
  outputFormat?: string(name='outputFormat', example='请返回如下JSON格式，{"key1":"","key2":""}'),
  tags?: [ 
    {
      tagDefinePrompt?: string(name='tagDefinePrompt', example='xxxx'),
      tagName?: string(name='tagName', example='xxxx'),
    }
  ](name='tags'),
  taskDescription?: string(name='taskDescription', example='给你一条待分析文本数据，请你按照标签体系来对数据进行打标。'),
}

model RunNetworkContentAuditShrinkRequest {
  apiKey?: string(name='apiKey'),
  businessType?: string(name='businessType', example='clueMining'),
  content?: string(name='content', description='This parameter is required.', example='待分析文本'),
  extraInfo?: string(name='extraInfo', example='额外信息'),
  modelId?: string(name='modelId', example='qwen-max'),
  outputFormat?: string(name='outputFormat', example='请返回如下JSON格式，{"key1":"","key2":""}'),
  tagsShrink?: string(name='tags'),
  taskDescription?: string(name='taskDescription', example='给你一条待分析文本数据，请你按照标签体系来对数据进行打标。'),
}

model RunNetworkContentAuditResponseBody = {
  header?: {
    errorCode?: string(name='errorCode', example='AccessForbidden'),
    errorMessage?: string(name='errorMessage', example='错误信息'),
    event?: string(name='event', example='task-finished'),
    sessionId?: string(name='sessionId', example='xxxx'),
    taskId?: string(name='taskId', example='xxxx'),
    traceId?: string(name='traceId', example='xxxxx'),
  }(name='header'),
  payload?: {
    output?: {
      text?: string(name='text', example='xxxx'),
    }(name='output'),
    usage?: {
      inputTokens?: long(name='inputTokens', example='100'),
      outputTokens?: long(name='outputTokens', example='100'),
      totalTokens?: long(name='totalTokens', example='200'),
    }(name='usage'),
  }(name='payload'),
  requestId?: string(name='requestId', description='Id of the request', example='5D0E915E-655D-59A8-894F-93873F73AAE5'),
}

model RunNetworkContentAuditResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RunNetworkContentAuditResponseBody(name='body'),
}

/**
 * @summary 轻应用-网络内容审核
 *
 * @param tmpReq RunNetworkContentAuditRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return RunNetworkContentAuditResponse
 */
async function runNetworkContentAuditWithOptions(workspaceId: string, tmpReq: RunNetworkContentAuditRequest, headers: map[string]string, runtime: Util.RuntimeOptions): RunNetworkContentAuditResponse {
  Util.validateModel(tmpReq);
  var request = new RunNetworkContentAuditShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.tags)) {
    request.tagsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tags, 'tags', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.apiKey)) {
    body['apiKey'] = request.apiKey;
  }
  if (!Util.isUnset(request.businessType)) {
    body['businessType'] = request.businessType;
  }
  if (!Util.isUnset(request.content)) {
    body['content'] = request.content;
  }
  if (!Util.isUnset(request.extraInfo)) {
    body['extraInfo'] = request.extraInfo;
  }
  if (!Util.isUnset(request.modelId)) {
    body['modelId'] = request.modelId;
  }
  if (!Util.isUnset(request.outputFormat)) {
    body['outputFormat'] = request.outputFormat;
  }
  if (!Util.isUnset(request.tagsShrink)) {
    body['tags'] = request.tagsShrink;
  }
  if (!Util.isUnset(request.taskDescription)) {
    body['taskDescription'] = request.taskDescription;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'RunNetworkContentAudit',
    version = '2024-08-01',
    protocol = 'HTTPS',
    pathname = `/${OpenApiUtil.getEncodeParam(workspaceId)}/quanmiao/lightapp/runNetworkContentAudit`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 轻应用-网络内容审核
 *
 * @param request RunNetworkContentAuditRequest
 * @return RunNetworkContentAuditResponse
 */
async function runNetworkContentAudit(workspaceId: string, request: RunNetworkContentAuditRequest): RunNetworkContentAuditResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return runNetworkContentAuditWithOptions(workspaceId, request, headers, runtime);
}

model RunScriptChatRequest {
  prompt?: string(name='prompt', description='This parameter is required.'),
  taskId?: string(name='taskId', example='a3d1c2ac-f086-4a21-9069-f5631542f5a2'),
}

model RunScriptChatResponseBody = {
  end?: boolean(name='end', example='true'),
  header?: {
    errorCode?: string(name='errorCode', example='403'),
    errorMessage?: string(name='errorMessage', example='Pop sign mismatch, please check log.'),
    event?: string(name='event', example='result-generated'),
    eventInfo?: string(name='eventInfo'),
    requestId?: string(name='requestId', example='F8A35034-EDCF-5C50-95A5-1044316F36E3'),
    sessionId?: string(name='sessionId', example='147648697127_914847410985_1730600302167'),
    taskId?: string(name='taskId', example='d3be9981-ca2d-4e17-bf31-1c0a628e9f99'),
    traceId?: string(name='traceId', example='2150432017236011824686132ecdbc'),
  }(name='header'),
  payload?: {
    output?: {
      text?: string(name='text'),
    }(name='output'),
    usage?: {
      inputTokens?: long(name='inputTokens', example='100'),
      outputTokens?: long(name='outputTokens', example='100'),
      totalTokens?: long(name='totalTokens', example='200'),
    }(name='usage'),
  }(name='payload'),
}

model RunScriptChatResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RunScriptChatResponseBody(name='body'),
}

/**
 * @summary 长剧本创作
 *
 * @param request RunScriptChatRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return RunScriptChatResponse
 */
async function runScriptChatWithOptions(workspaceId: string, request: RunScriptChatRequest, headers: map[string]string, runtime: Util.RuntimeOptions): RunScriptChatResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.prompt)) {
    body['prompt'] = request.prompt;
  }
  if (!Util.isUnset(request.taskId)) {
    body['taskId'] = request.taskId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'RunScriptChat',
    version = '2024-08-01',
    protocol = 'HTTPS',
    pathname = `/${OpenApiUtil.getEncodeParam(workspaceId)}/quanmiao/lightapp/runScriptChat`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 长剧本创作
 *
 * @param request RunScriptChatRequest
 * @return RunScriptChatResponse
 */
async function runScriptChat(workspaceId: string, request: RunScriptChatRequest): RunScriptChatResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return runScriptChatWithOptions(workspaceId, request, headers, runtime);
}

model RunScriptContinueRequest {
  scriptSummary?: string(name='scriptSummary', example='一队全副武装的执法人员和消防员闯入了一间明显已被遗弃多日、门窗紧闭并用胶带封死的公寓，面对着屋内令人作呕的恶臭和门厅里的混乱场面，他们似乎在寻找某种隐藏的真相或危险源，而一封日期为16号的信件成为了揭开谜团的关键线索，随着便衣探员深入探索，一系列封闭的房间暗示着这里曾发生过不为人知的秘密事件。'),
  scriptTypeKeyword?: string(name='scriptTypeKeyword', example='悬疑，都市，惊悚'),
  userProvidedContent?: string(name='userProvidedContent', description='This parameter is required.', example='门厅一片狼藉。朝向天井的窗户开着。公寓门突然被撞开了。\\n一名便衣探员、两名穿制服的警察和几位消防员———也身着工作服———进来，四下张望。他们都戴着手套以及盖住口鼻的面罩。在他们身后，门房和他妻子也挤进门厅。他们都捂着鼻子。门房的另一只手里拿着一叠信件和促销广告单。他们身后，跟着一位女邻居。\\n便衣探员（对门房和邻居）：请在外面等候。\\n他向一名警察示意，警察正忙着把好奇的旁观者请出门外。\\n警察（对门房，指着那一叠信件）：最近的一封是哪天的？\\n门房（查对信件）：最近的一封似乎是16号的......等一下......\\n便衣探员想打开左侧的门，却是徒劳。门用胶带封上了。\\n便衣探员（对消防员）：你来试一下好吗？\\n消防员摆弄门的时候，便衣探员进了卧室隔壁的餐厅。他迅速打开窗，转身，想经过对开门进左侧的房间。这两扇门也锁着，门缝被贴上了胶带。他右转进入起居室，也打开了窗户'),
}

model RunScriptContinueResponseBody = {
  end?: boolean(name='end'),
  header?: {
    errorCode?: string(name='errorCode', example='403'),
    errorMessage?: string(name='errorMessage', example='Pop sign mismatch, please check.'),
    event?: string(name='event', example='result-generated'),
    eventInfo?: string(name='eventInfo', example='模型生成事件'),
    requestId?: string(name='requestId', example='0EB27AE3-CA53-5FAE-83C6-EE66CA4DF5DF'),
    sessionId?: string(name='sessionId', example='3cd10828-0e42-471c-8f1a-931cde20b035'),
    taskId?: string(name='taskId', example='d3be9981-ca2d-4e17-bf31-1c0a628e9f99'),
    traceId?: string(name='traceId', example='2150451a17191950923411783e2927'),
  }(name='header'),
  payload?: {
    output?: {
      text?: string(name='text', example='这是测试输出'),
    }(name='output'),
    usage?: {
      inputTokens?: long(name='inputTokens', example='100'),
      outputTokens?: long(name='outputTokens', example='100'),
      totalTokens?: long(name='totalTokens', example='200'),
    }(name='usage'),
  }(name='payload'),
}

model RunScriptContinueResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RunScriptContinueResponseBody(name='body'),
}

/**
 * @summary 剧本续写
 *
 * @param request RunScriptContinueRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return RunScriptContinueResponse
 */
async function runScriptContinueWithOptions(workspaceId: string, request: RunScriptContinueRequest, headers: map[string]string, runtime: Util.RuntimeOptions): RunScriptContinueResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.scriptSummary)) {
    body['scriptSummary'] = request.scriptSummary;
  }
  if (!Util.isUnset(request.scriptTypeKeyword)) {
    body['scriptTypeKeyword'] = request.scriptTypeKeyword;
  }
  if (!Util.isUnset(request.userProvidedContent)) {
    body['userProvidedContent'] = request.userProvidedContent;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'RunScriptContinue',
    version = '2024-08-01',
    protocol = 'HTTPS',
    pathname = `/${OpenApiUtil.getEncodeParam(workspaceId)}/quanmiao/lightapp/runScriptContinue`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 剧本续写
 *
 * @param request RunScriptContinueRequest
 * @return RunScriptContinueResponse
 */
async function runScriptContinue(workspaceId: string, request: RunScriptContinueRequest): RunScriptContinueResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return runScriptContinueWithOptions(workspaceId, request, headers, runtime);
}

model RunScriptPlanningRequest {
  additionalNote?: string(name='additionalNote', example='故事尽可能狗血'),
  dialogueInScene?: boolean(name='dialogueInScene'),
  plotConflict?: boolean(name='plotConflict'),
  scriptName?: string(name='scriptName', example='都市战神'),
  scriptShotCount?: int32(name='scriptShotCount', example='3'),
  scriptSummary?: string(name='scriptSummary', description='This parameter is required.', example='在一个宁静的小镇上，每个家庭都在同一天收到一个神秘的、没有标记的包裹。'),
  scriptTypeKeyword?: string(name='scriptTypeKeyword', example='现代，都市，爱情，玄幻'),
}

model RunScriptPlanningResponseBody = {
  end?: boolean(name='end'),
  header?: {
    errorCode?: string(name='errorCode', example='403'),
    errorMessage?: string(name='errorMessage', example='Pop sign mismatch, please check.'),
    event?: string(name='event', example='result-generated'),
    eventInfo?: string(name='eventInfo', example='模型生成事件'),
    requestId?: string(name='requestId', example='0EB27AE3-CA53-5FAE-83C6-EE66CA4DF5DF'),
    sessionId?: string(name='sessionId', example='3cd10828-0e42-471c-8f1a-931cde20b035'),
    taskId?: string(name='taskId', example='d3be9981-ca2d-4e17-bf31-1c0a628e9f99'),
    traceId?: string(name='traceId', example='2150451a17191950923411783e2927'),
  }(name='header'),
  payload?: {
    output?: {
      text?: string(name='text', example='这是测试输出'),
    }(name='output'),
    usage?: {
      inputTokens?: long(name='inputTokens', example='100'),
      outputTokens?: long(name='outputTokens', example='100'),
      totalTokens?: long(name='totalTokens', example='200'),
    }(name='usage'),
  }(name='payload'),
}

model RunScriptPlanningResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RunScriptPlanningResponseBody(name='body'),
}

/**
 * @summary 剧本策划
 *
 * @param request RunScriptPlanningRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return RunScriptPlanningResponse
 */
async function runScriptPlanningWithOptions(workspaceId: string, request: RunScriptPlanningRequest, headers: map[string]string, runtime: Util.RuntimeOptions): RunScriptPlanningResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.additionalNote)) {
    body['additionalNote'] = request.additionalNote;
  }
  if (!Util.isUnset(request.dialogueInScene)) {
    body['dialogueInScene'] = request.dialogueInScene;
  }
  if (!Util.isUnset(request.plotConflict)) {
    body['plotConflict'] = request.plotConflict;
  }
  if (!Util.isUnset(request.scriptName)) {
    body['scriptName'] = request.scriptName;
  }
  if (!Util.isUnset(request.scriptShotCount)) {
    body['scriptShotCount'] = request.scriptShotCount;
  }
  if (!Util.isUnset(request.scriptSummary)) {
    body['scriptSummary'] = request.scriptSummary;
  }
  if (!Util.isUnset(request.scriptTypeKeyword)) {
    body['scriptTypeKeyword'] = request.scriptTypeKeyword;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'RunScriptPlanning',
    version = '2024-08-01',
    protocol = 'HTTPS',
    pathname = `/${OpenApiUtil.getEncodeParam(workspaceId)}/quanmiao/lightapp/runScriptPlanning`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 剧本策划
 *
 * @param request RunScriptPlanningRequest
 * @return RunScriptPlanningResponse
 */
async function runScriptPlanning(workspaceId: string, request: RunScriptPlanningRequest): RunScriptPlanningResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return runScriptPlanningWithOptions(workspaceId, request, headers, runtime);
}

model RunScriptRefineRequest {
  taskId?: string(name='taskId', example='a3d1c2ac-f086-4a21-9069-f5631542f5a2'),
}

model RunScriptRefineResponseBody = {
  end?: boolean(name='end'),
  header?: {
    errorCode?: string(name='errorCode', example='403'),
    errorMessage?: string(name='errorMessage', example='Pop sign mismatch, please check log.'),
    event?: string(name='event', example='result-generated'),
    eventInfo?: string(name='eventInfo'),
    requestId?: string(name='requestId', example='F8A35034-EDCF-5C50-95A5-1044316F36E3'),
    sessionId?: string(name='sessionId', example='17dc8bcd-f34a-46d1-a7a3-0fa3d1ce3824'),
    taskId?: string(name='taskId', example='14356391-6c6c-40d5-b80a-8ecd03b69d72'),
    traceId?: string(name='traceId', example='2150432017236011824686132ecdbc'),
  }(name='header'),
  payload?: {
    output?: {
      content?: [ map[string]string ](name='content'),
      outline?: string(name='outline'),
      role?: string(name='role'),
      scene?: string(name='scene'),
      summary?: string(name='summary'),
      text?: string(name='text', example='xx'),
    }(name='output'),
    usage?: {
      inputTokens?: long(name='inputTokens', example='100'),
      outputTokens?: long(name='outputTokens', example='100'),
      totalTokens?: long(name='totalTokens', example='200'),
    }(name='usage'),
  }(name='payload'),
}

model RunScriptRefineResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RunScriptRefineResponseBody(name='body'),
}

/**
 * @summary 剧本对话内容的整理
 *
 * @param request RunScriptRefineRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return RunScriptRefineResponse
 */
async function runScriptRefineWithOptions(workspaceId: string, request: RunScriptRefineRequest, headers: map[string]string, runtime: Util.RuntimeOptions): RunScriptRefineResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.taskId)) {
    body['taskId'] = request.taskId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'RunScriptRefine',
    version = '2024-08-01',
    protocol = 'HTTPS',
    pathname = `/${OpenApiUtil.getEncodeParam(workspaceId)}/quanmiao/lightapp/runScriptRefine`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 剧本对话内容的整理
 *
 * @param request RunScriptRefineRequest
 * @return RunScriptRefineResponse
 */
async function runScriptRefine(workspaceId: string, request: RunScriptRefineRequest): RunScriptRefineResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return runScriptRefineWithOptions(workspaceId, request, headers, runtime);
}

model RunStyleWritingRequest {
  learningSamples?: [ string ](name='learningSamples'),
  processStage?: string(name='processStage'),
  referenceMaterials?: [ string ](name='referenceMaterials'),
  styleFeature?: string(name='styleFeature'),
  useSearch?: boolean(name='useSearch'),
  writingTheme?: string(name='writingTheme'),
}

model RunStyleWritingShrinkRequest {
  learningSamplesShrink?: string(name='learningSamples'),
  processStage?: string(name='processStage'),
  referenceMaterialsShrink?: string(name='referenceMaterials'),
  styleFeature?: string(name='styleFeature'),
  useSearch?: boolean(name='useSearch'),
  writingTheme?: string(name='writingTheme'),
}

model RunStyleWritingResponseBody = {
  end?: boolean(name='end', example='true'),
  header?: {
    errorCode?: string(name='errorCode', example='403'),
    errorMessage?: string(name='errorMessage', example='Pop sign mismatch, please check log.'),
    event?: string(name='event', example='task-progress-start-generating'),
    eventInfo?: string(name='eventInfo'),
    requestId?: string(name='requestId', example='0EB27AE3-CA53-5FAE-83C6-EE66CA4DF5DF'),
    sessionId?: string(name='sessionId', example='3cd10828-0e42-471c-8f1a-931cde20b035'),
    taskId?: string(name='taskId', example='d3be9981-ca2d-4e17-bf31-1c0a628e9f99'),
    traceId?: string(name='traceId', example='2150451a17191950923411783e2927'),
  }(name='header', example='{"event":"task-progress-start-generating","sessionId":"3cd10828-0e42-471c-8f1a-931cde20b035","taskId":"d3be9981-ca2d-4e17-bf31-1c0a628e9f99","traceId":"66bef4a7f5d61ff3c43f3b710574e175"}'),
  payload?: {
    output?: {
      text?: string(name='text'),
    }(name='output'),
    usage?: {
      inputTokens?: long(name='inputTokens', example='100'),
      outputTokens?: long(name='outputTokens', example='100'),
      totalTokens?: long(name='totalTokens', example='200'),
    }(name='usage', example='{
        "inputTokens": 1816,
        "outputTokens": 96,
        "totalTokens": 1912
    }'),
  }(name='payload'),
}

model RunStyleWritingResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RunStyleWritingResponseBody(name='body'),
}

/**
 * @summary 文体学习和写作推理服务
 *
 * @param tmpReq RunStyleWritingRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return RunStyleWritingResponse
 */
async function runStyleWritingWithOptions(workspaceId: string, tmpReq: RunStyleWritingRequest, headers: map[string]string, runtime: Util.RuntimeOptions): RunStyleWritingResponse {
  Util.validateModel(tmpReq);
  var request = new RunStyleWritingShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.learningSamples)) {
    request.learningSamplesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.learningSamples, 'learningSamples', 'json');
  }
  if (!Util.isUnset(tmpReq.referenceMaterials)) {
    request.referenceMaterialsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.referenceMaterials, 'referenceMaterials', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.learningSamplesShrink)) {
    body['learningSamples'] = request.learningSamplesShrink;
  }
  if (!Util.isUnset(request.processStage)) {
    body['processStage'] = request.processStage;
  }
  if (!Util.isUnset(request.referenceMaterialsShrink)) {
    body['referenceMaterials'] = request.referenceMaterialsShrink;
  }
  if (!Util.isUnset(request.styleFeature)) {
    body['styleFeature'] = request.styleFeature;
  }
  if (!Util.isUnset(request.useSearch)) {
    body['useSearch'] = request.useSearch;
  }
  if (!Util.isUnset(request.writingTheme)) {
    body['writingTheme'] = request.writingTheme;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'RunStyleWriting',
    version = '2024-08-01',
    protocol = 'HTTPS',
    pathname = `/${OpenApiUtil.getEncodeParam(workspaceId)}/quanmiao/lightapp/runStyleWriting`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 文体学习和写作推理服务
 *
 * @param request RunStyleWritingRequest
 * @return RunStyleWritingResponse
 */
async function runStyleWriting(workspaceId: string, request: RunStyleWritingRequest): RunStyleWritingResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return runStyleWritingWithOptions(workspaceId, request, headers, runtime);
}

model RunTagMiningAnalysisRequest {
  apiKey?: string(name='apiKey'),
  businessType?: string(name='businessType', example='clueMining'),
  content?: string(name='content', description='This parameter is required.', example='待分析文本'),
  extraInfo?: string(name='extraInfo', example='额外信息'),
  modelId?: string(name='modelId', example='qwen-max'),
  outputFormat?: string(name='outputFormat', example='请返回如下JSON格式，{"key1":"","key2":""}'),
  tags?: [ 
    {
      tagDefinePrompt?: string(name='tagDefinePrompt', example='xxxx'),
      tagName?: string(name='tagName', example='xxxx'),
    }
  ](name='tags'),
  taskDescription?: string(name='taskDescription', example='给你一条待分析文本数据，请你按照标签体系来对数据进行打标。'),
}

model RunTagMiningAnalysisShrinkRequest {
  apiKey?: string(name='apiKey'),
  businessType?: string(name='businessType', example='clueMining'),
  content?: string(name='content', description='This parameter is required.', example='待分析文本'),
  extraInfo?: string(name='extraInfo', example='额外信息'),
  modelId?: string(name='modelId', example='qwen-max'),
  outputFormat?: string(name='outputFormat', example='请返回如下JSON格式，{"key1":"","key2":""}'),
  tagsShrink?: string(name='tags'),
  taskDescription?: string(name='taskDescription', example='给你一条待分析文本数据，请你按照标签体系来对数据进行打标。'),
}

model RunTagMiningAnalysisResponseBody = {
  header?: {
    errorCode?: string(name='errorCode', example='AccessForbidden'),
    errorMessage?: string(name='errorMessage', example='错误信息'),
    event?: string(name='event', example='task-finished'),
    sessionId?: string(name='sessionId', example='xxxx'),
    taskId?: string(name='taskId', example='xxxx'),
    traceId?: string(name='traceId', example='xxxxx'),
  }(name='header'),
  payload?: {
    output?: {
      text?: string(name='text'),
    }(name='output'),
    usage?: {
      inputTokens?: long(name='inputTokens', example='100'),
      outputTokens?: long(name='outputTokens', example='100'),
      totalTokens?: long(name='totalTokens', example='200'),
    }(name='usage'),
  }(name='payload'),
  requestId?: string(name='requestId', description='Id of the request', example='085BE2D2-BB7E-59A6-B688-F2CB32124E7F'),
}

model RunTagMiningAnalysisResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RunTagMiningAnalysisResponseBody(name='body'),
}

/**
 * @summary 轻应用-标签挖掘
 *
 * @param tmpReq RunTagMiningAnalysisRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return RunTagMiningAnalysisResponse
 */
async function runTagMiningAnalysisWithOptions(workspaceId: string, tmpReq: RunTagMiningAnalysisRequest, headers: map[string]string, runtime: Util.RuntimeOptions): RunTagMiningAnalysisResponse {
  Util.validateModel(tmpReq);
  var request = new RunTagMiningAnalysisShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.tags)) {
    request.tagsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tags, 'tags', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.apiKey)) {
    body['apiKey'] = request.apiKey;
  }
  if (!Util.isUnset(request.businessType)) {
    body['businessType'] = request.businessType;
  }
  if (!Util.isUnset(request.content)) {
    body['content'] = request.content;
  }
  if (!Util.isUnset(request.extraInfo)) {
    body['extraInfo'] = request.extraInfo;
  }
  if (!Util.isUnset(request.modelId)) {
    body['modelId'] = request.modelId;
  }
  if (!Util.isUnset(request.outputFormat)) {
    body['outputFormat'] = request.outputFormat;
  }
  if (!Util.isUnset(request.tagsShrink)) {
    body['tags'] = request.tagsShrink;
  }
  if (!Util.isUnset(request.taskDescription)) {
    body['taskDescription'] = request.taskDescription;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'RunTagMiningAnalysis',
    version = '2024-08-01',
    protocol = 'HTTPS',
    pathname = `/${OpenApiUtil.getEncodeParam(workspaceId)}/quanmiao/lightapp/runTagMiningAnalysis`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 轻应用-标签挖掘
 *
 * @param request RunTagMiningAnalysisRequest
 * @return RunTagMiningAnalysisResponse
 */
async function runTagMiningAnalysis(workspaceId: string, request: RunTagMiningAnalysisRequest): RunTagMiningAnalysisResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return runTagMiningAnalysisWithOptions(workspaceId, request, headers, runtime);
}

model RunVideoAnalysisRequest {
  excludeGenerateOptions?: [ string ](name='excludeGenerateOptions'),
  faceIdentitySimilarityMinScore?: float(name='faceIdentitySimilarityMinScore'),
  frameSampleMethod?: {
    interval?: double(name='interval'),
    methodName?: string(name='methodName'),
    pixel?: int32(name='pixel'),
  }(name='frameSampleMethod'),
  generateOptions?: [ string ](name='generateOptions'),
  language?: string(name='language', example='english'),
  modelCustomPromptTemplate?: string(name='modelCustomPromptTemplate'),
  modelCustomPromptTemplateId?: string(name='modelCustomPromptTemplateId', example='PlotDetail'),
  modelId?: string(name='modelId', example='qwen-max'),
  originalSessionId?: string(name='originalSessionId', example='a3d1c2ac-f086-4a21-9069-f5631542f5ax'),
  snapshotInterval?: double(name='snapshotInterval'),
  splitInterval?: int32(name='splitInterval', example='10'),
  taskId?: string(name='taskId', example='a3d1c2ac-f086-4a21-9069-f5631542f5a2'),
  textProcessTasks?: [ 
    {
      modelCustomPromptTemplate?: string(name='modelCustomPromptTemplate'),
      modelCustomPromptTemplateId?: string(name='modelCustomPromptTemplateId'),
      modelId?: string(name='modelId'),
    }
  ](name='textProcessTasks'),
  videoExtraInfo?: string(name='videoExtraInfo'),
  videoModelCustomPromptTemplate?: string(name='videoModelCustomPromptTemplate'),
  videoModelId?: string(name='videoModelId', example='qwen-vl-max'),
  videoRoles?: [ 
    {
      roleInfo?: string(name='roleInfo'),
      roleName?: string(name='roleName'),
      urls?: [ string ](name='urls'),
    }
  ](name='videoRoles'),
  videoShotFaceIdentityCount?: int32(name='videoShotFaceIdentityCount'),
  videoUrl?: string(name='videoUrl', example='http://xxxx.mp4'),
}

model RunVideoAnalysisShrinkRequest {
  excludeGenerateOptionsShrink?: string(name='excludeGenerateOptions'),
  faceIdentitySimilarityMinScore?: float(name='faceIdentitySimilarityMinScore'),
  frameSampleMethodShrink?: string(name='frameSampleMethod'),
  generateOptionsShrink?: string(name='generateOptions'),
  language?: string(name='language', example='english'),
  modelCustomPromptTemplate?: string(name='modelCustomPromptTemplate'),
  modelCustomPromptTemplateId?: string(name='modelCustomPromptTemplateId', example='PlotDetail'),
  modelId?: string(name='modelId', example='qwen-max'),
  originalSessionId?: string(name='originalSessionId', example='a3d1c2ac-f086-4a21-9069-f5631542f5ax'),
  snapshotInterval?: double(name='snapshotInterval'),
  splitInterval?: int32(name='splitInterval', example='10'),
  taskId?: string(name='taskId', example='a3d1c2ac-f086-4a21-9069-f5631542f5a2'),
  textProcessTasksShrink?: string(name='textProcessTasks'),
  videoExtraInfo?: string(name='videoExtraInfo'),
  videoModelCustomPromptTemplate?: string(name='videoModelCustomPromptTemplate'),
  videoModelId?: string(name='videoModelId', example='qwen-vl-max'),
  videoRolesShrink?: string(name='videoRoles'),
  videoShotFaceIdentityCount?: int32(name='videoShotFaceIdentityCount'),
  videoUrl?: string(name='videoUrl', example='http://xxxx.mp4'),
}

model RunVideoAnalysisResponseBody = {
  header?: {
    errorCode?: string(name='errorCode', example='InvalidParam'),
    errorMessage?: string(name='errorMessage', example='Pop sign mismatch, please check log.'),
    event?: string(name='event', example='task-progress-start-generating'),
    eventInfo?: string(name='eventInfo'),
    sessionId?: string(name='sessionId', example='xxx'),
    taskId?: string(name='taskId', example='xxx'),
    traceId?: string(name='traceId', example='2150432017236011824686132ecdbc'),
  }(name='header'),
  payload?: {
    output?: {
      resultJsonFileUrl?: string(name='resultJsonFileUrl', example='http://'),
      videoAnalysisResult?: {
        generateFinished?: boolean(name='generateFinished', example='true'),
        modelId?: string(name='modelId', example='qwen-vl-max'),
        text?: string(name='text'),
        usage?: {
          inputTokens?: long(name='inputTokens', example='1'),
          outputTokens?: long(name='outputTokens', example='1'),
          totalTokens?: long(name='totalTokens', example='1'),
        }(name='usage'),
        videoShotAnalysisResults?: [ 
          {
            endTime?: long(name='endTime', example='10000'),
            startTime?: long(name='startTime', example='1000'),
            text?: string(name='text'),
          }
        ](name='videoShotAnalysisResults'),
      }(name='videoAnalysisResult'),
      videoCaptionResult?: {
        generateFinished?: boolean(name='generateFinished', example='true'),
        videoCaptions?: [ 
          {
            endTime?: long(name='endTime', example='1710432000000'),
            endTimeFormat?: string(name='endTimeFormat', example='00:01'),
            startTime?: long(name='startTime', example='0'),
            startTimeFormat?: string(name='startTimeFormat', example='00:01'),
            text?: string(name='text', example='xxx'),
          }
        ](name='videoCaptions'),
      }(name='videoCaptionResult'),
      videoGenerateResult?: {
        generateFinished?: boolean(name='generateFinished', example='true'),
        index?: int32(name='index'),
        modelId?: string(name='modelId', example='qwen-max'),
        modelReduce?: boolean(name='modelReduce'),
        reasonText?: string(name='reasonText'),
        text?: string(name='text'),
        usage?: {
          inputTokens?: long(name='inputTokens', example='1'),
          outputTokens?: long(name='outputTokens', example='1'),
          totalTokens?: long(name='totalTokens', example='1'),
        }(name='usage'),
      }(name='videoGenerateResult'),
      videoGenerateResults?: [ 
        {
          generateFinished?: boolean(name='generateFinished'),
          index?: int32(name='index'),
          modelId?: string(name='modelId'),
          reasonText?: string(name='reasonText'),
          text?: string(name='text'),
          usage?: {
            inputTokens?: long(name='inputTokens'),
            outputTokens?: long(name='outputTokens'),
            totalTokens?: long(name='totalTokens'),
          }(name='usage'),
        }
      ](name='videoGenerateResults'),
      videoMindMappingGenerateResult?: {
        generateFinished?: boolean(name='generateFinished', example='true'),
        modelId?: string(name='modelId', example='true'),
        modelReduce?: boolean(name='modelReduce'),
        text?: string(name='text'),
        usage?: {
          inputTokens?: long(name='inputTokens', example='1'),
          outputTokens?: long(name='outputTokens', example='1'),
          totalTokens?: long(name='totalTokens', example='1'),
        }(name='usage'),
        videoMindMappings?: [ 
          {
            childNodes?: [ 
              {
                childNodes?: [ 
                  {
                    name?: string(name='name'),
                  }
                ](name='childNodes'),
                name?: string(name='name'),
              }
            ](name='childNodes'),
            name?: string(name='name'),
          }
        ](name='videoMindMappings'),
      }(name='videoMindMappingGenerateResult'),
      videoShotSnapshotResult?: {
        videoShots?: [ 
          {
            endTime?: long(name='endTime'),
            endTimeFormat?: string(name='endTimeFormat'),
            startTime?: long(name='startTime'),
            startTimeFormat?: string(name='startTimeFormat'),
            videoSnapshots?: [ 
              {
                url?: string(name='url'),
              }
            ](name='videoSnapshots'),
          }
        ](name='videoShots'),
      }(name='videoShotSnapshotResult'),
      videoTitleGenerateResult?: {
        generateFinished?: boolean(name='generateFinished', example='true'),
        modelId?: string(name='modelId', example='qwen-max'),
        modelReduce?: boolean(name='modelReduce'),
        text?: string(name='text'),
        usage?: {
          inputTokens?: long(name='inputTokens', example='1'),
          outputTokens?: long(name='outputTokens', example='1'),
          totalTokens?: long(name='totalTokens', example='2'),
        }(name='usage'),
      }(name='videoTitleGenerateResult'),
    }(name='output'),
    usage?: {
      inputTokens?: long(name='inputTokens'),
      outputTokens?: long(name='outputTokens'),
      totalTokens?: long(name='totalTokens'),
    }(name='usage'),
  }(name='payload'),
  requestId?: string(name='requestId', example='117F5ABE-CF02-5502-9A3F-E56BC9081A64'),
}

model RunVideoAnalysisResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RunVideoAnalysisResponseBody(name='body'),
}

/**
 * @summary 轻应用-视频理解
 *
 * @param tmpReq RunVideoAnalysisRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return RunVideoAnalysisResponse
 */
async function runVideoAnalysisWithOptions(workspaceId: string, tmpReq: RunVideoAnalysisRequest, headers: map[string]string, runtime: Util.RuntimeOptions): RunVideoAnalysisResponse {
  Util.validateModel(tmpReq);
  var request = new RunVideoAnalysisShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.excludeGenerateOptions)) {
    request.excludeGenerateOptionsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.excludeGenerateOptions, 'excludeGenerateOptions', 'json');
  }
  if (!Util.isUnset(tmpReq.frameSampleMethod)) {
    request.frameSampleMethodShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.frameSampleMethod, 'frameSampleMethod', 'json');
  }
  if (!Util.isUnset(tmpReq.generateOptions)) {
    request.generateOptionsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.generateOptions, 'generateOptions', 'json');
  }
  if (!Util.isUnset(tmpReq.textProcessTasks)) {
    request.textProcessTasksShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.textProcessTasks, 'textProcessTasks', 'json');
  }
  if (!Util.isUnset(tmpReq.videoRoles)) {
    request.videoRolesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.videoRoles, 'videoRoles', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.excludeGenerateOptionsShrink)) {
    body['excludeGenerateOptions'] = request.excludeGenerateOptionsShrink;
  }
  if (!Util.isUnset(request.faceIdentitySimilarityMinScore)) {
    body['faceIdentitySimilarityMinScore'] = request.faceIdentitySimilarityMinScore;
  }
  if (!Util.isUnset(request.frameSampleMethodShrink)) {
    body['frameSampleMethod'] = request.frameSampleMethodShrink;
  }
  if (!Util.isUnset(request.generateOptionsShrink)) {
    body['generateOptions'] = request.generateOptionsShrink;
  }
  if (!Util.isUnset(request.language)) {
    body['language'] = request.language;
  }
  if (!Util.isUnset(request.modelCustomPromptTemplate)) {
    body['modelCustomPromptTemplate'] = request.modelCustomPromptTemplate;
  }
  if (!Util.isUnset(request.modelCustomPromptTemplateId)) {
    body['modelCustomPromptTemplateId'] = request.modelCustomPromptTemplateId;
  }
  if (!Util.isUnset(request.modelId)) {
    body['modelId'] = request.modelId;
  }
  if (!Util.isUnset(request.originalSessionId)) {
    body['originalSessionId'] = request.originalSessionId;
  }
  if (!Util.isUnset(request.snapshotInterval)) {
    body['snapshotInterval'] = request.snapshotInterval;
  }
  if (!Util.isUnset(request.splitInterval)) {
    body['splitInterval'] = request.splitInterval;
  }
  if (!Util.isUnset(request.taskId)) {
    body['taskId'] = request.taskId;
  }
  if (!Util.isUnset(request.textProcessTasksShrink)) {
    body['textProcessTasks'] = request.textProcessTasksShrink;
  }
  if (!Util.isUnset(request.videoExtraInfo)) {
    body['videoExtraInfo'] = request.videoExtraInfo;
  }
  if (!Util.isUnset(request.videoModelCustomPromptTemplate)) {
    body['videoModelCustomPromptTemplate'] = request.videoModelCustomPromptTemplate;
  }
  if (!Util.isUnset(request.videoModelId)) {
    body['videoModelId'] = request.videoModelId;
  }
  if (!Util.isUnset(request.videoRolesShrink)) {
    body['videoRoles'] = request.videoRolesShrink;
  }
  if (!Util.isUnset(request.videoShotFaceIdentityCount)) {
    body['videoShotFaceIdentityCount'] = request.videoShotFaceIdentityCount;
  }
  if (!Util.isUnset(request.videoUrl)) {
    body['videoUrl'] = request.videoUrl;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'RunVideoAnalysis',
    version = '2024-08-01',
    protocol = 'HTTPS',
    pathname = `/${OpenApiUtil.getEncodeParam(workspaceId)}/quanmiao/lightapp/runVideoAnalysis`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 轻应用-视频理解
 *
 * @param request RunVideoAnalysisRequest
 * @return RunVideoAnalysisResponse
 */
async function runVideoAnalysis(workspaceId: string, request: RunVideoAnalysisRequest): RunVideoAnalysisResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return runVideoAnalysisWithOptions(workspaceId, request, headers, runtime);
}

model SubmitEnterpriseVocAnalysisTaskRequest {
  apiKey?: string(name='apiKey'),
  contents?: [ 
    {
      id?: string(name='id', example='id-xxxxx'),
      text?: string(name='text', example='xxxx'),
    }
  ](name='contents'),
  extraInfo?: string(name='extraInfo'),
  fileKey?: string(name='fileKey', example='oss://default/aimiaobi-service-prod/aimiaobi/temp/public/government_service_experience_feedback_summary.txt'),
  filterTags?: [ 
    {
      tagDefinePrompt?: string(name='tagDefinePrompt'),
      tagName?: string(name='tagName'),
    }
  ](name='filterTags'),
  modelId?: string(name='modelId', example='qwen-max'),
  outputFormat?: string(name='outputFormat'),
  tags?: [ 
    {
      tagDefinePrompt?: string(name='tagDefinePrompt', example='xxxx'),
      tagName?: string(name='tagName', example='xxxx'),
    }
  ](name='tags'),
  taskDescription?: string(name='taskDescription'),
  url?: string(name='url', example='http://www.example.com/xxxx.txt'),
}

model SubmitEnterpriseVocAnalysisTaskShrinkRequest {
  apiKey?: string(name='apiKey'),
  contentsShrink?: string(name='contents'),
  extraInfo?: string(name='extraInfo'),
  fileKey?: string(name='fileKey', example='oss://default/aimiaobi-service-prod/aimiaobi/temp/public/government_service_experience_feedback_summary.txt'),
  filterTagsShrink?: string(name='filterTags'),
  modelId?: string(name='modelId', example='qwen-max'),
  outputFormat?: string(name='outputFormat'),
  tagsShrink?: string(name='tags'),
  taskDescription?: string(name='taskDescription'),
  url?: string(name='url', example='http://www.example.com/xxxx.txt'),
}

model SubmitEnterpriseVocAnalysisTaskResponseBody = {
  code?: string(name='code', example='NoPermission'),
  data?: {
    taskId?: string(name='taskId', example='a0cc71ec-fe07-47e5-bf12-6e1c46081c98'),
  }(name='data'),
  httpStatusCode?: int32(name='httpStatusCode', example='403'),
  message?: string(name='message'),
  requestId?: string(name='requestId', description='Id of the request', example='117F5ABE-CF02-5502-9A3F-E56BC9081A64'),
  success?: boolean(name='success', example='false'),
}

model SubmitEnterpriseVocAnalysisTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SubmitEnterpriseVocAnalysisTaskResponseBody(name='body'),
}

/**
 * @summary 提交企业VOC异步任务
 *
 * @param tmpReq SubmitEnterpriseVocAnalysisTaskRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return SubmitEnterpriseVocAnalysisTaskResponse
 */
async function submitEnterpriseVocAnalysisTaskWithOptions(workspaceId: string, tmpReq: SubmitEnterpriseVocAnalysisTaskRequest, headers: map[string]string, runtime: Util.RuntimeOptions): SubmitEnterpriseVocAnalysisTaskResponse {
  Util.validateModel(tmpReq);
  var request = new SubmitEnterpriseVocAnalysisTaskShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.contents)) {
    request.contentsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.contents, 'contents', 'json');
  }
  if (!Util.isUnset(tmpReq.filterTags)) {
    request.filterTagsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.filterTags, 'filterTags', 'json');
  }
  if (!Util.isUnset(tmpReq.tags)) {
    request.tagsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tags, 'tags', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.apiKey)) {
    body['apiKey'] = request.apiKey;
  }
  if (!Util.isUnset(request.contentsShrink)) {
    body['contents'] = request.contentsShrink;
  }
  if (!Util.isUnset(request.extraInfo)) {
    body['extraInfo'] = request.extraInfo;
  }
  if (!Util.isUnset(request.fileKey)) {
    body['fileKey'] = request.fileKey;
  }
  if (!Util.isUnset(request.filterTagsShrink)) {
    body['filterTags'] = request.filterTagsShrink;
  }
  if (!Util.isUnset(request.modelId)) {
    body['modelId'] = request.modelId;
  }
  if (!Util.isUnset(request.outputFormat)) {
    body['outputFormat'] = request.outputFormat;
  }
  if (!Util.isUnset(request.tagsShrink)) {
    body['tags'] = request.tagsShrink;
  }
  if (!Util.isUnset(request.taskDescription)) {
    body['taskDescription'] = request.taskDescription;
  }
  if (!Util.isUnset(request.url)) {
    body['url'] = request.url;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'SubmitEnterpriseVocAnalysisTask',
    version = '2024-08-01',
    protocol = 'HTTPS',
    pathname = `/${OpenApiUtil.getEncodeParam(workspaceId)}/quanmiao/lightapp/submitEnterpriseVocAnalysisTask`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 提交企业VOC异步任务
 *
 * @param request SubmitEnterpriseVocAnalysisTaskRequest
 * @return SubmitEnterpriseVocAnalysisTaskResponse
 */
async function submitEnterpriseVocAnalysisTask(workspaceId: string, request: SubmitEnterpriseVocAnalysisTaskRequest): SubmitEnterpriseVocAnalysisTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return submitEnterpriseVocAnalysisTaskWithOptions(workspaceId, request, headers, runtime);
}

model SubmitTagMiningAnalysisTaskRequest {
  apiKey?: string(name='apiKey'),
  businessType?: string(name='businessType', example='clueMining'),
  contents?: [ string ](name='contents'),
  extraInfo?: string(name='extraInfo', example='额外信息'),
  modelId?: string(name='modelId', example='qwen-max'),
  outputFormat?: string(name='outputFormat', example='请返回如下JSON格式，{"key1":"","key2":""}'),
  tags?: [ 
    {
      tagDefinePrompt?: string(name='tagDefinePrompt', example='xxxx'),
      tagName?: string(name='tagName', example='xxxx'),
    }
  ](name='tags'),
  taskDescription?: string(name='taskDescription', example='给你一条待分析文本数据，请你按照标签体系来对数据进行打标。'),
  url?: string(name='url', example='http://www.example.com/xxxx.txt'),
}

model SubmitTagMiningAnalysisTaskShrinkRequest {
  apiKey?: string(name='apiKey'),
  businessType?: string(name='businessType', example='clueMining'),
  contentsShrink?: string(name='contents'),
  extraInfo?: string(name='extraInfo', example='额外信息'),
  modelId?: string(name='modelId', example='qwen-max'),
  outputFormat?: string(name='outputFormat', example='请返回如下JSON格式，{"key1":"","key2":""}'),
  tagsShrink?: string(name='tags'),
  taskDescription?: string(name='taskDescription', example='给你一条待分析文本数据，请你按照标签体系来对数据进行打标。'),
  url?: string(name='url', example='http://www.example.com/xxxx.txt'),
}

model SubmitTagMiningAnalysisTaskResponseBody = {
  code?: string(name='code', example='successful'),
  data?: {
    taskId?: string(name='taskId', example='3feb69ed02d9b1a17d0f1a942675d300'),
  }(name='data'),
  httpStatusCode?: int32(name='httpStatusCode', example='200'),
  message?: string(name='message', example='ok'),
  requestId?: string(name='requestId', description='Id of the request', example='117F5ABE-CF02-5502-9A3F-E56BC9081A64'),
  success?: boolean(name='success', example='true'),
}

model SubmitTagMiningAnalysisTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SubmitTagMiningAnalysisTaskResponseBody(name='body'),
}

/**
 * @summary 轻应用-标签挖掘
 *
 * @param tmpReq SubmitTagMiningAnalysisTaskRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return SubmitTagMiningAnalysisTaskResponse
 */
async function submitTagMiningAnalysisTaskWithOptions(workspaceId: string, tmpReq: SubmitTagMiningAnalysisTaskRequest, headers: map[string]string, runtime: Util.RuntimeOptions): SubmitTagMiningAnalysisTaskResponse {
  Util.validateModel(tmpReq);
  var request = new SubmitTagMiningAnalysisTaskShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.contents)) {
    request.contentsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.contents, 'contents', 'json');
  }
  if (!Util.isUnset(tmpReq.tags)) {
    request.tagsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tags, 'tags', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.apiKey)) {
    body['apiKey'] = request.apiKey;
  }
  if (!Util.isUnset(request.businessType)) {
    body['businessType'] = request.businessType;
  }
  if (!Util.isUnset(request.contentsShrink)) {
    body['contents'] = request.contentsShrink;
  }
  if (!Util.isUnset(request.extraInfo)) {
    body['extraInfo'] = request.extraInfo;
  }
  if (!Util.isUnset(request.modelId)) {
    body['modelId'] = request.modelId;
  }
  if (!Util.isUnset(request.outputFormat)) {
    body['outputFormat'] = request.outputFormat;
  }
  if (!Util.isUnset(request.tagsShrink)) {
    body['tags'] = request.tagsShrink;
  }
  if (!Util.isUnset(request.taskDescription)) {
    body['taskDescription'] = request.taskDescription;
  }
  if (!Util.isUnset(request.url)) {
    body['url'] = request.url;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'SubmitTagMiningAnalysisTask',
    version = '2024-08-01',
    protocol = 'HTTPS',
    pathname = `/${OpenApiUtil.getEncodeParam(workspaceId)}/quanmiao/lightapp/submitTagMiningAnalysisTask`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 轻应用-标签挖掘
 *
 * @param request SubmitTagMiningAnalysisTaskRequest
 * @return SubmitTagMiningAnalysisTaskResponse
 */
async function submitTagMiningAnalysisTask(workspaceId: string, request: SubmitTagMiningAnalysisTaskRequest): SubmitTagMiningAnalysisTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return submitTagMiningAnalysisTaskWithOptions(workspaceId, request, headers, runtime);
}

model SubmitVideoAnalysisTaskRequest {
  deduplicationId?: string(name='deduplicationId', example='1'),
  excludeGenerateOptions?: [ string ](name='excludeGenerateOptions'),
  faceIdentitySimilarityMinScore?: float(name='faceIdentitySimilarityMinScore'),
  frameSampleMethod?: {
    interval?: double(name='interval', example='2'),
    methodName?: string(name='methodName', example='standard'),
    pixel?: int32(name='pixel', example='768'),
  }(name='frameSampleMethod'),
  generateOptions?: [ string ](name='generateOptions'),
  language?: string(name='language', example='chinese'),
  modelCustomPromptTemplate?: string(name='modelCustomPromptTemplate'),
  modelCustomPromptTemplateId?: string(name='modelCustomPromptTemplateId', example='PlotDetail'),
  modelId?: string(name='modelId', example='qwen-max'),
  snapshotInterval?: double(name='snapshotInterval', example='2'),
  splitInterval?: int32(name='splitInterval', example='10'),
  textProcessTasks?: [ 
    {
      modelCustomPromptTemplate?: string(name='modelCustomPromptTemplate'),
      modelCustomPromptTemplateId?: string(name='modelCustomPromptTemplateId'),
      modelId?: string(name='modelId'),
    }
  ](name='textProcessTasks'),
  videoExtraInfo?: string(name='videoExtraInfo'),
  videoModelCustomPromptTemplate?: string(name='videoModelCustomPromptTemplate'),
  videoModelId?: string(name='videoModelId', example='qwen-vl-max-latest'),
  videoRoles?: [ 
    {
      roleInfo?: string(name='roleInfo'),
      roleName?: string(name='roleName'),
      urls?: [ string ](name='urls'),
    }
  ](name='videoRoles'),
  videoShotFaceIdentityCount?: int32(name='videoShotFaceIdentityCount'),
  videoUrl?: string(name='videoUrl', description='This parameter is required.', example='http://xxxx.mp4'),
}

model SubmitVideoAnalysisTaskShrinkRequest {
  deduplicationId?: string(name='deduplicationId', example='1'),
  excludeGenerateOptionsShrink?: string(name='excludeGenerateOptions'),
  faceIdentitySimilarityMinScore?: float(name='faceIdentitySimilarityMinScore'),
  frameSampleMethodShrink?: string(name='frameSampleMethod'),
  generateOptionsShrink?: string(name='generateOptions'),
  language?: string(name='language', example='chinese'),
  modelCustomPromptTemplate?: string(name='modelCustomPromptTemplate'),
  modelCustomPromptTemplateId?: string(name='modelCustomPromptTemplateId', example='PlotDetail'),
  modelId?: string(name='modelId', example='qwen-max'),
  snapshotInterval?: double(name='snapshotInterval', example='2'),
  splitInterval?: int32(name='splitInterval', example='10'),
  textProcessTasksShrink?: string(name='textProcessTasks'),
  videoExtraInfo?: string(name='videoExtraInfo'),
  videoModelCustomPromptTemplate?: string(name='videoModelCustomPromptTemplate'),
  videoModelId?: string(name='videoModelId', example='qwen-vl-max-latest'),
  videoRolesShrink?: string(name='videoRoles'),
  videoShotFaceIdentityCount?: int32(name='videoShotFaceIdentityCount'),
  videoUrl?: string(name='videoUrl', description='This parameter is required.', example='http://xxxx.mp4'),
}

model SubmitVideoAnalysisTaskResponseBody = {
  code?: string(name='code', example='xx'),
  data?: {
    taskId?: string(name='taskId', example='3feb69ed02d9b1a17d0f1a942675d300'),
  }(name='data'),
  httpStatusCode?: int32(name='httpStatusCode', example='200'),
  message?: string(name='message', example='success'),
  requestId?: string(name='requestId', example='085BE2D2-BB7E-59A6-B688-F2CB32124E7F'),
  success?: boolean(name='success', example='True'),
}

model SubmitVideoAnalysisTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SubmitVideoAnalysisTaskResponseBody(name='body'),
}

/**
 * @summary 轻应用-提交视频理解任务
 *
 * @param tmpReq SubmitVideoAnalysisTaskRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return SubmitVideoAnalysisTaskResponse
 */
async function submitVideoAnalysisTaskWithOptions(workspaceId: string, tmpReq: SubmitVideoAnalysisTaskRequest, headers: map[string]string, runtime: Util.RuntimeOptions): SubmitVideoAnalysisTaskResponse {
  Util.validateModel(tmpReq);
  var request = new SubmitVideoAnalysisTaskShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.excludeGenerateOptions)) {
    request.excludeGenerateOptionsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.excludeGenerateOptions, 'excludeGenerateOptions', 'json');
  }
  if (!Util.isUnset(tmpReq.frameSampleMethod)) {
    request.frameSampleMethodShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.frameSampleMethod, 'frameSampleMethod', 'json');
  }
  if (!Util.isUnset(tmpReq.generateOptions)) {
    request.generateOptionsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.generateOptions, 'generateOptions', 'json');
  }
  if (!Util.isUnset(tmpReq.textProcessTasks)) {
    request.textProcessTasksShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.textProcessTasks, 'textProcessTasks', 'json');
  }
  if (!Util.isUnset(tmpReq.videoRoles)) {
    request.videoRolesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.videoRoles, 'videoRoles', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.deduplicationId)) {
    body['deduplicationId'] = request.deduplicationId;
  }
  if (!Util.isUnset(request.excludeGenerateOptionsShrink)) {
    body['excludeGenerateOptions'] = request.excludeGenerateOptionsShrink;
  }
  if (!Util.isUnset(request.faceIdentitySimilarityMinScore)) {
    body['faceIdentitySimilarityMinScore'] = request.faceIdentitySimilarityMinScore;
  }
  if (!Util.isUnset(request.frameSampleMethodShrink)) {
    body['frameSampleMethod'] = request.frameSampleMethodShrink;
  }
  if (!Util.isUnset(request.generateOptionsShrink)) {
    body['generateOptions'] = request.generateOptionsShrink;
  }
  if (!Util.isUnset(request.language)) {
    body['language'] = request.language;
  }
  if (!Util.isUnset(request.modelCustomPromptTemplate)) {
    body['modelCustomPromptTemplate'] = request.modelCustomPromptTemplate;
  }
  if (!Util.isUnset(request.modelCustomPromptTemplateId)) {
    body['modelCustomPromptTemplateId'] = request.modelCustomPromptTemplateId;
  }
  if (!Util.isUnset(request.modelId)) {
    body['modelId'] = request.modelId;
  }
  if (!Util.isUnset(request.snapshotInterval)) {
    body['snapshotInterval'] = request.snapshotInterval;
  }
  if (!Util.isUnset(request.splitInterval)) {
    body['splitInterval'] = request.splitInterval;
  }
  if (!Util.isUnset(request.textProcessTasksShrink)) {
    body['textProcessTasks'] = request.textProcessTasksShrink;
  }
  if (!Util.isUnset(request.videoExtraInfo)) {
    body['videoExtraInfo'] = request.videoExtraInfo;
  }
  if (!Util.isUnset(request.videoModelCustomPromptTemplate)) {
    body['videoModelCustomPromptTemplate'] = request.videoModelCustomPromptTemplate;
  }
  if (!Util.isUnset(request.videoModelId)) {
    body['videoModelId'] = request.videoModelId;
  }
  if (!Util.isUnset(request.videoRolesShrink)) {
    body['videoRoles'] = request.videoRolesShrink;
  }
  if (!Util.isUnset(request.videoShotFaceIdentityCount)) {
    body['videoShotFaceIdentityCount'] = request.videoShotFaceIdentityCount;
  }
  if (!Util.isUnset(request.videoUrl)) {
    body['videoUrl'] = request.videoUrl;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'SubmitVideoAnalysisTask',
    version = '2024-08-01',
    protocol = 'HTTPS',
    pathname = `/${OpenApiUtil.getEncodeParam(workspaceId)}/quanmiao/lightapp/videoAnalysis/submitVideoAnalysisTask`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 轻应用-提交视频理解任务
 *
 * @param request SubmitVideoAnalysisTaskRequest
 * @return SubmitVideoAnalysisTaskResponse
 */
async function submitVideoAnalysisTask(workspaceId: string, request: SubmitVideoAnalysisTaskRequest): SubmitVideoAnalysisTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return submitVideoAnalysisTaskWithOptions(workspaceId, request, headers, runtime);
}

model UpdateVideoAnalysisConfigRequest {
  asyncConcurrency?: int32(name='asyncConcurrency', description='This parameter is required.', example='2'),
}

model UpdateVideoAnalysisConfigResponseBody = {
  code?: string(name='code', example='xx'),
  httpStatusCode?: int32(name='httpStatusCode', example='200'),
  message?: string(name='message', example='ok'),
  requestId?: string(name='requestId', description='Id of the request', example='5D0E915E-655D-59A8-894F-93873F73AAE5'),
  success?: boolean(name='success', example='True'),
}

model UpdateVideoAnalysisConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateVideoAnalysisConfigResponseBody(name='body'),
}

/**
 * @summary 视频理解-更新配置
 *
 * @param request UpdateVideoAnalysisConfigRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateVideoAnalysisConfigResponse
 */
async function updateVideoAnalysisConfigWithOptions(workspaceId: string, request: UpdateVideoAnalysisConfigRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateVideoAnalysisConfigResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.asyncConcurrency)) {
    body['asyncConcurrency'] = request.asyncConcurrency;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateVideoAnalysisConfig',
    version = '2024-08-01',
    protocol = 'HTTPS',
    pathname = `/${OpenApiUtil.getEncodeParam(workspaceId)}/quanmiao/lightapp/videoAnalysis/updateVideoAnalysisConfig`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 视频理解-更新配置
 *
 * @param request UpdateVideoAnalysisConfigRequest
 * @return UpdateVideoAnalysisConfigResponse
 */
async function updateVideoAnalysisConfig(workspaceId: string, request: UpdateVideoAnalysisConfigRequest): UpdateVideoAnalysisConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateVideoAnalysisConfigWithOptions(workspaceId, request, headers, runtime);
}

